{"openapi":"3.1.0","info":{"title":"Rulebase API2","version":"0.0.1"},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"Rulebase organization API key"}},"schemas":{"program_sampling_rule_condition":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true}},"required":["field","operator"]},"program_sampling_rule_tier":{"type":"object","properties":{"min":{"type":"integer","nullable":true},"max":{"type":"integer","nullable":true},"value":{"type":"integer","nullable":true},"value_type":{"type":"string","nullable":true}},"required":["min","max","value","value_type"]},"program_sampling_rule_sampling_strategy":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["census"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["percentage"]},"value":{"type":"integer"}},"required":["type","value"]},{"type":"object","properties":{"type":{"type":"string","enum":["tiered"]},"tiers":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_tier"}}},"required":["type","tiers"]},{"nullable":true}]},"test_report_finding":{"type":"object","properties":{"risk_level":{"type":"string","enum":["high","medium","low"]},"description":{"type":"string"}},"required":["risk_level","description"]},"test_report_question_result":{"type":"object","properties":{"question":{"type":"string"},"sheet_column_id":{"type":"string","nullable":true},"positive_count":{"type":"integer"},"negative_count":{"type":"integer"},"indeterminate_count":{"type":"integer"}},"required":["question","sheet_column_id","positive_count","negative_count","indeterminate_count"]},"test_report_control_result":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"question_results":{"type":"array","items":{"$ref":"#/components/schemas/test_report_question_result"}}},"required":["name","description","question_results"]},"LinkedActivityThread":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"initial_contact_at":{"type":"string","nullable":true,"format":"date-time"},"last_contact_at":{"type":"string","nullable":true,"format":"date-time"},"contacts_count":{"type":"integer","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"screening_search":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"provider":{"type":"string"},"external_id":{"type":"string"},"source_url":{"type":"string"},"status":{"type":"string"},"fetched_at":{"type":"string","nullable":true},"redacted_at":{"type":"string","nullable":true},"issues":{"type":"array","items":{"type":"string"}},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","provider","external_id","source_url","status","fetched_at","redacted_at","issues","data"]},"screening_search_origin":{"type":"string","nullable":true},"id":{"type":"string"},"type":{"type":"string"},"conversation_origin":{"type":"string","nullable":true},"jira_issue_origin":{"type":"string","nullable":true},"linear_issue_origin":{"type":"string","nullable":true},"slack_message_origin":{"type":"string","nullable":true},"work_item_origin":{"type":"string","nullable":true},"entity_created_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"subject":{"type":"string"},"summary":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"ticket_status":{"type":"string","enum":["open","resolved"]},"external_url":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","type"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","type"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]}},"required":["id","employee"]}}},"required":["id","external_id","subject","summary","jira_issue_key","ticket_status","external_url","external_created_at","created_at","updated_at","data_source","requester","conversation_agents"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string","nullable":true},"service_desk_url":{"type":"string","nullable":true}},"required":["id","issue_key","summary","status_category","url","service_desk_url"]},"linear_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"identifier":{"type":"string"},"title":{"type":"string"},"state_name":{"type":"string","nullable":true},"state_type":{"type":"string","nullable":true},"url":{"type":"string"},"team_key":{"type":"string","nullable":true},"assignee_name":{"type":"string","nullable":true},"priority_label":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","identifier","title","state_name","state_type","url","team_key","assignee_name","priority_label","created_at","updated_at"]},"slack_message":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"url":{"type":"string"},"external_created_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","url","external_created_at"]},"work_item":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"short_description":{"type":"string","nullable":true}},"required":["id","external_id","type","status","short_description"]},"customer_complaint":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"created_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","title","summary","status","priority","created_at"]}},"required":["id","type","conversation_origin","jira_issue_origin","linear_issue_origin","slack_message_origin","work_item_origin","entity_created_at","created_at","updated_at","conversation","jira_issue","linear_issue","slack_message","work_item"]}}},"required":["id","initial_contact_at","last_contact_at","contacts_count","created_at","updated_at","items"]},"ConversationPartParty":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"evaluable":{"type":"boolean","nullable":true},"custom_attributes":{"nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","email","phone"]},"ConversationPartAttachment":{"type":"object","properties":{"id":{"type":"string"},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"size":{"type":"number","nullable":true},"file_url":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","filename","content_type","size","file_url","removed_at","created_at","updated_at"]},"ConversationPartCallTranscriptMessage":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"text_english":{"type":"string","nullable":true},"author_type":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"confidence":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation_cx_risk_snapshot_compliance_rule_results":{"type":"array","items":{"nullable":true}}},"required":["id","text","text_english","author_type","start","end","confidence","created_at","updated_at","conversation_cx_risk_snapshot_compliance_rule_results"]},"ConversationPartCallDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"direction":{"type":"string","nullable":true,"enum":["inbound","outbound"]},"terminated_by":{"type":"string","nullable":true,"enum":["agent","customer","system"]},"language":{"type":"string","nullable":true},"from_phone":{"type":"string","nullable":true},"to_phone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"recording":{"type":"object","nullable":true,"properties":{"url":{"type":"string"},"expires_at":{"type":"string"}},"required":["url","expires_at"]},"to":{"$ref":"#/components/schemas/ConversationPartParty"},"from":{"$ref":"#/components/schemas/ConversationPartParty"},"to_employee":{"$ref":"#/components/schemas/ConversationPartParty"},"from_employee":{"$ref":"#/components/schemas/ConversationPartParty"},"to_client":{"$ref":"#/components/schemas/ConversationPartParty"},"from_client":{"$ref":"#/components/schemas/ConversationPartParty"},"conversation_part_call_detail_transcript_messages":{"type":"array","items":{"$ref":"#/components/schemas/ConversationPartCallTranscriptMessage"}}},"required":["id","direction","terminated_by","language","from_phone","to_phone","created_at","updated_at","recording","to","from","to_employee","from_employee","to_client","from_client","conversation_part_call_detail_transcript_messages"]},"ConversationPartBase":{"type":"object","properties":{"id":{"type":"string"},"author_type":{"type":"string"},"author_name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"url":{"type":"string","nullable":true},"image_caption":{"type":"string","nullable":true},"body":{"type":"string","nullable":true},"html_body":{"type":"string","nullable":true},"body_english":{"type":"string","nullable":true},"ai_agent_authored":{"type":"boolean","nullable":true},"ai_generated_answer":{"type":"boolean","nullable":true},"data":{"nullable":true},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"author":{"$ref":"#/components/schemas/ConversationPartParty"},"attachments":{"type":"array","items":{"$ref":"#/components/schemas/ConversationPartAttachment"}},"sla_breaches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}}},"required":["id","author_type","author_name","external_id","external_created_at","created_at","updated_at","url","image_caption","body","html_body","body_english","ai_agent_authored","ai_generated_answer","data_source","author","attachments","sla_breaches"]},"CallConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["call"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartCallDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartChatDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"html_content":{"type":"string","nullable":true},"sent_at":{"type":"string","nullable":true},"uses_redacted_tag":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","content","html_content","sent_at","uses_redacted_tag","created_at","updated_at"]},"ChatConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["chat"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartChatDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartEmailDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"body":{"type":"string","nullable":true},"html_body":{"type":"string","nullable":true},"to_name":{"type":"string","nullable":true},"to_email":{"type":"string","nullable":true},"from_name":{"type":"string","nullable":true},"from_email":{"type":"string","nullable":true},"uses_redacted_tag":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body","html_body","to_name","to_email","from_name","from_email","uses_redacted_tag","created_at","updated_at"]},"EmailConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartEmailDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartNoteDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"body":{"type":"string","nullable":true},"html_body":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body","html_body","created_at","updated_at"]},"NoteConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["note"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartNoteDetail"}},"required":["type","conversation_part_detail"]}]},"SideConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["side_conversation"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartNoteDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartAssignmentDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"body":{"type":"string"},"assigned_to":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body","assigned_to","created_at","updated_at"]},"AssignmentConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["assignment"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartAssignmentDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartAttributeUpdateDetail":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"data":{"nullable":true},"field_name":{"type":"string","nullable":true},"value":{"nullable":true},"previous_value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","field_name","created_at","updated_at"]},"AttributeUpdateConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["attribute_updated_by_admin"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartAttributeUpdateDetail"}},"required":["type","conversation_part_detail"]}]},"ConversationPartMacroReferenceDetail":{"type":"object","nullable":true,"properties":{"macro_title":{"type":"string"}},"required":["macro_title"]},"MacroReferenceConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["macro_reference"]},"conversation_part_detail":{"$ref":"#/components/schemas/ConversationPartMacroReferenceDetail"}},"required":["type","conversation_part_detail"]}]},"OpenConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["open"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"CloseConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["close"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"BotActionConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["bot_action"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"BotWorkflowEventConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["bot_workflow_event"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"BotRuntimeEventConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["bot_runtime_event"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"QuickReplyConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["quick_reply"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"ProviderEventConversationPart":{"allOf":[{"$ref":"#/components/schemas/ConversationPartBase"},{"type":"object","properties":{"type":{"type":"string","enum":["provider_event"]},"conversation_part_detail":{"nullable":true}},"required":["type","conversation_part_detail"]}]},"ConversationPart":{"anyOf":[{"$ref":"#/components/schemas/CallConversationPart"},{"$ref":"#/components/schemas/ChatConversationPart"},{"$ref":"#/components/schemas/EmailConversationPart"},{"$ref":"#/components/schemas/NoteConversationPart"},{"$ref":"#/components/schemas/SideConversationPart"},{"$ref":"#/components/schemas/AssignmentConversationPart"},{"$ref":"#/components/schemas/AttributeUpdateConversationPart"},{"$ref":"#/components/schemas/MacroReferenceConversationPart"},{"$ref":"#/components/schemas/OpenConversationPart"},{"$ref":"#/components/schemas/CloseConversationPart"},{"$ref":"#/components/schemas/BotActionConversationPart"},{"$ref":"#/components/schemas/BotWorkflowEventConversationPart"},{"$ref":"#/components/schemas/BotRuntimeEventConversationPart"},{"$ref":"#/components/schemas/QuickReplyConversationPart"},{"$ref":"#/components/schemas/ProviderEventConversationPart"}]},"Scorecard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"active_scorecard_version_id":{"type":"string","nullable":true},"restored_from_scorecard_version_id":{"type":"string","nullable":true},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"conditions":{"type":"array","items":{"type":"object","properties":{"condition_type":{"type":"string"},"value":{"nullable":true}},"required":["condition_type"]}},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","account"]}},"required":["id","name","description","created_at","updated_at","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","active_scorecard_version_id","restored_from_scorecard_version_id","groups","conditions","created_by"]},"ScorecardCriterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"integer","nullable":true},"ai_evaluations_enabled":{"type":"boolean"},"requires_style_guide_context":{"type":"boolean"},"requires_authentication_context":{"type":"boolean"},"requires_knowledge_base_context":{"type":"boolean"},"evaluation_strictness":{"type":"string"},"knowledge_base_document_ids":{"type":"array","items":{"type":"string"}},"weight":{"type":"number"},"parent_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"guiding_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"value":{"type":"number","nullable":true},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score_option_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"check_id":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"nullable":true}},"required":["id","type","content","created_at","updated_at","score_option_id","full_name","check_id","criterion_id"]}}},"required":["id","label","type","value","justification_options"]}},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score_option_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"check_id":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"nullable":true}},"required":["id","type","content","created_at","updated_at","score_option_id","full_name","check_id","criterion_id"]}},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","field","created_at","updated_at"]}}},"required":["id","description","instructions","position","created_at","updated_at","justification_options","conditions"]}},"children":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterion"}}},"required":["id","description","instructions","position","scoring_type","max_score","ai_evaluations_enabled","requires_style_guide_context","requires_authentication_context","requires_knowledge_base_context","evaluation_strictness","knowledge_base_document_ids","weight","parent_id","scorecard_id","scorecard_name","guiding_questions","score_options","checks","children"]},"ScorecardFull":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"active_scorecard_version_id":{"type":"string","nullable":true},"restored_from_scorecard_version_id":{"type":"string","nullable":true},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"conditions":{"type":"array","items":{"type":"object","properties":{"condition_type":{"type":"string"},"value":{"nullable":true}},"required":["condition_type"]}},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","account"]},"scorecard_cap_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"criterion_id":{"type":"string"},"result_score_types":{"nullable":true},"cap_score":{"type":"number","nullable":true},"position":{"type":"integer","nullable":true}},"required":["id","criterion_id","cap_score","position"]}},"scorecard_criteria":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterion"}}},"required":["id","name","description","created_at","updated_at","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","active_scorecard_version_id","restored_from_scorecard_version_id","groups","conditions","created_by","scorecard_cap_rules","scorecard_criteria"]},"ScorecardFormParams":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"two_level":{"type":"boolean","nullable":true},"is_primary":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true,"enum":["draft","published"]},"lock_version":{"type":"integer","nullable":true},"group_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"condition_type":{"type":"string"},"value":{"type":"array","nullable":true,"items":{"type":"string"}}},"required":["condition_type"]}},"scorecard_cap_rules":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"cap_score":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"position":{"type":"integer","nullable":true},"result_score_types":{"type":"array","nullable":true,"items":{"type":"string"}},"_destroy":{"type":"boolean","nullable":true}}}},"scorecard_criteria":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"max_score":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"ai_evaluations_enabled":{"type":"boolean","nullable":true},"requires_knowledge_base_context":{"type":"boolean","nullable":true},"knowledge_base_document_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"score_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"type":{"type":"string","nullable":true},"justification_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"_destroy":{"type":"boolean","nullable":true}}}},"_destroy":{"type":"boolean","nullable":true}}}},"checks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"justification_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"score_option_id":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"type":"array","nullable":true,"items":{"type":"string"}},"_destroy":{"type":"boolean","nullable":true}}}},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string"},"value":{"type":"array","nullable":true,"items":{"type":"string"}},"_destroy":{"type":"boolean","nullable":true}},"required":["field"]}},"_destroy":{"type":"boolean","nullable":true}}}},"_destroy":{"type":"boolean","nullable":true},"children":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"max_score":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"ai_evaluations_enabled":{"type":"boolean","nullable":true},"requires_knowledge_base_context":{"type":"boolean","nullable":true},"knowledge_base_document_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"score_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"type":{"type":"string","nullable":true},"justification_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"_destroy":{"type":"boolean","nullable":true}}}},"_destroy":{"type":"boolean","nullable":true}}}},"checks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"justification_options":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"score_option_id":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"type":"array","nullable":true,"items":{"type":"string"}},"_destroy":{"type":"boolean","nullable":true}}}},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string"},"value":{"type":"array","nullable":true,"items":{"type":"string"}},"_destroy":{"type":"boolean","nullable":true}},"required":["field"]}},"_destroy":{"type":"boolean","nullable":true}}}},"_destroy":{"type":"boolean","nullable":true}}}}}}}}},"ScorecardEvaluationResultSummary":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"scorecard":{"$ref":"#/components/schemas/Scorecard"},"conversation_id":{"type":"string"},"data_source_name":{"type":"string","nullable":true},"agent_names":{"type":"string","nullable":true},"customer_names":{"type":"string"}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","scorecard","conversation_id","data_source_name","agent_names","customer_names"]},"ScorecardEvaluationStatistic":{"type":"object","properties":{"date":{"type":"string"},"conversation_count":{"type":"integer"},"average_score":{"type":"string","nullable":true}},"required":["date","conversation_count","average_score"]},"ScorecardEvaluationDefaultFilters":{"type":"object","properties":{"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","name"]},"team":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","name"]}},"required":["scorecard","team"]},"ScorecardCriterionAdherence":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"parent_id":{"type":"string","nullable":true},"is_header":{"type":"boolean"},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"}},"required":["id","name","parent_id","is_header","passed_count","partial_count","failed_count"]},"TicketResolutionResolverStatistic":{"type":"object","properties":{"resolver_id":{"type":"string","nullable":true},"resolver_name":{"type":"string"},"resolver_membership_id":{"type":"string","nullable":true},"tickets_resolved_count":{"type":"integer"}},"required":["resolver_id","resolver_name","resolver_membership_id","tickets_resolved_count"]},"ContestedEvaluationStatistic":{"type":"object","properties":{"contest_id":{"type":"string"},"agent_id":{"type":"string","nullable":true},"agent_name":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"status":{"type":"string"},"outcome":{"type":"string","enum":["unresolved","rejected","accepted"]},"qa_agent_evaluation_id":{"type":"string","nullable":true}},"required":["contest_id","agent_id","agent_name","conversation_id","conversation_external_id","status","outcome","qa_agent_evaluation_id"]},"ScorecardCriterionResultSummary":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_answer":{"type":"string","nullable":true},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"conversation_id":{"type":"string"},"qa_evaluation_id":{"type":"string","nullable":true},"data_source_name":{"type":"string","nullable":true},"agent_names":{"type":"string"},"customer_names":{"type":"string"}},"required":["id","score","max_score","weight","created_at","updated_at","knowledge_base_answer","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","knowledge_base_citations","conversation_id","qa_evaluation_id","data_source_name","agent_names","customer_names"]},"ScorecardCriterionResultStatistic":{"type":"object","properties":{"date":{"type":"string"},"conversation_count":{"type":"integer"},"average_score":{"type":"number"}},"required":["date","conversation_count","average_score"]},"QaAgentEvaluationScorecardCriterionResult":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}},"customer_names":{"type":"string"},"conversation_evaluation_summary":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children","customer_names","conversation_evaluation_summary"]},"ScorecardSection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecards":{"type":"array","items":{"$ref":"#/components/schemas/Scorecard"}}},"required":["id","name","created_at","updated_at","scorecards"]},"ScorecardVersion":{"type":"object","properties":{"id":{"type":"string"},"version_number":{"type":"integer"},"summary":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"uses_checks":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"is_active":{"type":"boolean"},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","account"]}},"required":["id","version_number","summary","name","description","condition","nested_criteria","two_level","uses_checks","created_at","updated_at","is_active","created_by"]},"EvaluationScorecardCriterionResultComment":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]},"EvaluationFeedbackCommentValidationErrors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}},"EvaluationScorecardCriterionResultCommentBody":{"type":"object","properties":{"evaluation_scorecard_criterion_result_comment":{"type":"object","properties":{"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"evaluation_guiding_question_answer_id":{"type":"string","nullable":true}}}},"required":["evaluation_scorecard_criterion_result_comment"]},"ScorecardCriterionScoreBreakdown":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true}},"required":["id","name","passed_count","partial_count","failed_count","average_score","previous_average_score","weight","max_score"]},"CalibrationGlobalAssignee":{"type":"object","properties":{"id":{"type":"string"},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_end_date":{"type":"string","nullable":true},"evaluation_batch_status":{"type":"string"},"evaluator_name":{"type":"string"},"evaluator_email":{"type":"string"},"evaluator_id":{"type":"string","nullable":true},"next_active_assignment_id":{"type":"string","nullable":true},"next_active_assignment_conversation_id":{"type":"string","nullable":true}},"required":["id","assignments_count","completed_count","created_at","updated_at","evaluation_batch_id","evaluation_batch_name","evaluation_batch_end_date","evaluation_batch_status","evaluator_name","evaluator_email","evaluator_id","next_active_assignment_id","next_active_assignment_conversation_id"]},"EvaluationSchedule":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"frequency":{"type":"string"},"status":{"type":"string"},"tickets_per_reviewer":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"next_batch_window_start_on":{"type":"string","nullable":true},"last_batch_window_start_on":{"type":"string","nullable":true},"duration":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"latest_batch_id":{"type":"string","nullable":true},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"channels":{"type":"array","items":{"type":"string"}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"assigned_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"assigned_roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string","nullable":true},"name":{"type":"string"}},"required":["id","key","name"]}},"assigned_scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"status":{"type":"string"}},"required":["id","name","status"]}},"evaluation_batches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}}},"required":["id","name","frequency","status","tickets_per_reviewer","created_at","updated_at","next_batch_window_start_on","last_batch_window_start_on","duration","evaluations_per_ticket","rotate_evaluator_pairs","latest_batch_id","zendesk_brand_ids","conversation_ids","group_ids","channels","assigned_zendesk_brands","groups","assigned_account_ids","assigned_role_ids","assigned_scorecard_ids","assigned_accounts","assigned_roles","assigned_scorecards","evaluation_batches"]},"CalibrationItemReview":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string"},"evaluator_membership_id":{"type":"string"},"evaluator_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"check_result_reactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["pass","fail"]},"evaluation_batch_conversation_review_id":{"type":"string"},"qa_agent_evaluation_scorecard_criterion_check_result_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","evaluation_batch_conversation_review_id","qa_agent_evaluation_scorecard_criterion_check_result_id","created_at","updated_at"]}},"check_comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string"},"evaluation_batch_conversation_review_id":{"type":"string"},"scorecard_criterion_check_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","content","evaluation_batch_conversation_review_id","scorecard_criterion_check_id","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","evaluation_batch_conversation_id","evaluator_membership_id","evaluator_membership","check_result_reactions","check_comments","created_at","updated_at"]},"DatasetMessage":{"type":"object","properties":{"role":{"type":"string","enum":["system","user","assistant","tool","human_agent"]},"name":{"type":"string"},"parts":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"content":{"type":"string"}},"required":["type","content"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_call"]},"id":{"type":"string","nullable":true},"name":{"type":"string"},"arguments":{"nullable":true}},"required":["type","id","name"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_call_response"]},"id":{"type":"string","nullable":true},"response":{"nullable":true},"rulebase.captured":{"type":"boolean"}},"required":["type","id"]}]}}},"required":["role","parts"]},"AgentMonitoringRubric":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"source":{"type":"string","enum":["system","custom"]},"systemKey":{"type":"string","nullable":true,"enum":["routing","correctness","grounding","resolution","tool_use","communication","safety"]},"enabled":{"type":"boolean"},"examples":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string","maxLength":120},"value":{"type":"number","minimum":0,"maximum":1},"expectedValue":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string","maxLength":500},"createdAt":{"type":"string","format":"date-time"}},"required":["railsConversationId","label","value","expectedValue","note","createdAt"]}},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","type","source","systemKey","enabled","examples","createdAt","updatedAt"]},"ZendeskBrand":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string"},"external_id":{"type":"string"},"tracking_status":{"type":"string","enum":["active","inactive"]},"help_center_locales":{"type":"array","nullable":true,"items":{"type":"string"}},"avatar_url":{"type":"string","nullable":true},"teams_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization_data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","name","subdomain","external_id","tracking_status","help_center_locales","avatar_url","teams_count","created_at","updated_at","organization_data_source"]}},"parameters":{}},"paths":{"/health":{"get":{"responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}}}}},"/accounts/sign_out":{"delete":{"responses":{"200":{"description":"Session revoked; continue through WorkOS logout","content":{"application/json":{"schema":{"type":"object","properties":{"logout_url":{"type":"string","format":"uri"}},"required":["logout_url"]}}}},"204":{"description":"Session revoked or already signed out"},"403":{"description":"Untrusted browser origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/organization":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1,"maxLength":255}},"required":["organization_id"]}}}},"responses":{"204":{"description":"Organization selected and session cookie renewed"},"401":{"description":"Sign in again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Untrusted origin or organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization authentication temporarily unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/account":{"get":{"responses":{"200":{"description":"Signed-in account, with or without an active organization","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"organization_id":{"type":"string","nullable":true},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["account_id","organization_id","account"]}}}},"401":{"description":"Sign in again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organizations":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name"]}},"required":["organization"]}}}},"responses":{"201":{"description":"Organization created and selected as the current tenant","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"401":{"description":"Sign in again","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Untrusted origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Workspace provisioning temporarily unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"responses":{"200":{"description":"Organizations available to the authenticated account","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]}}},"required":["data"]}}}}}}},"/accounts/auth/workos":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"redirect_uri","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"organization_id","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":255,"pattern":"^conn_[A-Za-z0-9]+$"},"required":false,"name":"connection_id","in":"query"},{"schema":{"type":"string","maxLength":320},"required":false,"name":"login_hint","in":"query"},{"schema":{"type":"string","maxLength":32},"required":false,"name":"screen_hint","in":"query"},{"schema":{"type":"string","enum":["1"]},"required":false,"name":"sso","in":"query"}],"responses":{"302":{"description":"Continue with hosted WorkOS authentication"},"503":{"description":"Authentication is unavailable"}}}},"/accounts/auth/workos/callback":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"code","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"state","in":"query"}],"responses":{"302":{"description":"Authentication completed or failed safely"}}}},"/accounts/auth/headless":{"get":{"responses":{"200":{"description":"Headless authentication rollout state","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}}}}},"/accounts/auth/csrf":{"get":{"responses":{"204":{"description":"Authentication cookies primed"},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/magic_auth":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"Next authentication method","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["sso","magic_auth","password"]}},"required":["method"]}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Magic Auth email could not be sent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/method":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"200":{"description":"Authentication method","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["sso","magic_auth"]}},"required":["method"]}}}},"204":{"description":"Authentication method resolved"},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/magic_auth/verify":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"},"code":{"type":"string","minLength":1,"maxLength":64},"full_name":{"type":"string","maxLength":255},"organization_id":{"type":"string","minLength":1,"maxLength":255}},"required":["email","code"]}}}},"responses":{"204":{"description":"Magic Auth completed"},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/password":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"},"password":{"type":"string","minLength":1,"maxLength":1024},"organization_id":{"type":"string","minLength":1,"maxLength":255}},"required":["email","password"]}}}},"responses":{"200":{"description":"Email verification required","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["email_verification"]}},"required":["method"]}}}},"204":{"description":"Password authentication completed"},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Signup rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/signup":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"},"password":{"type":"string","minLength":1,"maxLength":1024},"full_name":{"type":"string","maxLength":255},"organization_id":{"type":"string","minLength":1,"maxLength":255}},"required":["email","password","full_name"]}}}},"responses":{"200":{"description":"Email verification required","content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","enum":["email_verification"]}},"required":["method"]}}}},"204":{"description":"Password signup completed"},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Signup rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/email_verification/verify":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":64},"organization_id":{"type":"string","minLength":1,"maxLength":255}},"required":["code"]}}}},"responses":{"204":{"description":"Email verification completed"},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Authentication input expired or rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/email_verification/resend":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"204":{"description":"Verification email requested"},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Authentication input rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/email_verification/cancel":{"post":{"responses":{"204":{"description":"Pending verification cleared"},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/password_reset":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email"}},"required":["email"]}}}},"responses":{"204":{"description":"Password reset requested"},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/auth/password_reset/confirm":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1,"maxLength":2048},"password":{"type":"string","minLength":1,"maxLength":1024}},"required":["token","password"]}}}},"responses":{"204":{"description":"Password reset completed"},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Request origin or CSRF rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Headless authentication disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Authentication input expired or rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Too many attempts","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"}},"required":["error"]}}}}}}},"/session":{"get":{"responses":{"200":{"description":"Current authenticated session","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"organization_id":{"type":"string","nullable":true},"organization_internal_id":{"type":"number","nullable":true},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"role":{"type":"object","properties":{"id":{"type":"string"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}},"required":["id","permissions"]},"employee":{"nullable":true}},"required":["id","role"]},"accountId":{"type":"string"},"email":{"type":"string"},"organizationSlug":{"type":"string"},"userId":{"type":"string"},"organizationId":{"type":"string"},"membershipId":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"homepageDashboardId":{"type":"string","nullable":true},"homepagePage":{"type":"string","nullable":true,"enum":["performance","performance_my_teams"]},"homepageTeamId":{"type":"string","nullable":true},"sidebarTeamIds":{"type":"array","nullable":true,"items":{"type":"string"}},"lastExperience":{"type":"string","enum":["human_qa","agent_monitoring"]}},"required":["account_id","organization_id","organization_internal_id","account","membership","accountId","email","organizationSlug","userId","organizationId","membershipId","permissions","homepageDashboardId","homepagePage","homepageTeamId","sidebarTeamIds","lastExperience"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/experience":{"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"experience":{"type":"string","enum":["human_qa","agent_monitoring"]}},"required":["experience"]}}}},"responses":{"200":{"description":"Last app experience updated","content":{"application/json":{"schema":{"type":"object","properties":{"experience":{"type":"string","enum":["human_qa","agent_monitoring"]}},"required":["experience"]}}}},"404":{"description":"Membership not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/homepage":{"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"string","nullable":true,"enum":["performance","performance_my_teams"]},"team_id":{"type":"string","nullable":true}},"required":["page","team_id"]}}}},"responses":{"200":{"description":"Homepage updated","content":{"application/json":{"schema":{"type":"object","properties":{"homepagePage":{"type":"string","nullable":true,"enum":["performance","performance_my_teams"]},"homepageTeamId":{"type":"string","nullable":true}},"required":["homepagePage","homepageTeamId"]}}}},"404":{"description":"Team or membership not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/sidebar-teams":{"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"team_ids":{"type":"array","items":{"type":"string"},"maxItems":100}},"required":["team_ids"]}}}},"responses":{"200":{"description":"Sidebar teams updated","content":{"application/json":{"schema":{"type":"object","properties":{"sidebarTeamIds":{"type":"array","items":{"type":"string"}}},"required":["sidebarTeamIds"]}}}},"404":{"description":"Team or membership not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/session/notifications/call-summaries":{"get":{"responses":{"200":{"description":"Current member's post-call summary preference","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}}}},"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Post-call summary preference updated","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}}}}},"/agents":{"get":{"responses":{"200":{"description":"List agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"role":{"type":"string","enum":["onboarding"]},"createdByMembershipId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","role","createdByMembershipId","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"role":{"type":"string","enum":["onboarding"]}},"required":["name","description","role"],"additionalProperties":false}}}},"responses":{"201":{"description":"Agent created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"role":{"type":"string","enum":["onboarding"]},"createdByMembershipId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","role","createdByMembershipId","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid agent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agents/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"role":{"type":"string","enum":["onboarding"]},"createdByMembershipId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","role","createdByMembershipId","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1}},"additionalProperties":false}}}},"responses":{"200":{"description":"Agent updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"role":{"type":"string","enum":["onboarding"]},"createdByMembershipId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","role","createdByMembershipId","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid agent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows":{"get":{"parameters":[{"schema":{"type":"string","enum":["published","draft"]},"required":false,"name":"publication_status","in":"query"}],"responses":{"200":{"description":"List of agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"instructions":{"type":"string"},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"],"default":"workflow"},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]},"default":[]},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]},"default":[]},"templateId":{"type":"string","nullable":true}},"required":["name"]}}}},"responses":{"201":{"description":"Agent created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid workflow graph","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Email inbox address conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/tool-registry":{"get":{"responses":{"200":{"description":"Agent graph tool registry","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"category":{"type":"string","enum":["builtin","integration","mcp","custom"]},"icon":{"type":"string"},"auth":{"type":"object","properties":{"type":{"type":"string","enum":["none","api_key","oauth","static_token"]},"provider":{"type":"string"}},"required":["type"]},"operations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"connection":{"type":"object","nullable":true,"properties":{"provider":{"type":"string"},"required":{"type":"boolean"}},"required":["provider","required"]},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","string_array","text","enum","boolean","email_recipients","key_value_pairs","sheet"]},"required":{"type":"boolean"},"description":{"type":"string"},"placeholder":{"type":"string"},"defaultValue":{"anyOf":[{"type":"string"},{"type":"boolean"}]},"options":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"lookup":{"type":"object","properties":{"kind":{"type":"string","enum":["integration_assignee"]},"contextParam":{"type":"string"},"searchLabel":{"type":"string"}},"required":["kind"]}},"required":["name","label","type","required"]}}},"required":["id","name","description","connection","params"]}}},"required":["id","name","category","auth","operations"]}}},"required":["data"]}}}}}}},"/workflows/graph/layout":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"graph":{"type":"object","properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]}},"required":["graph"],"additionalProperties":false}}}},"responses":{"200":{"description":"Laid out agent graph","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"graph":{"type":"object","properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]}},"required":["graph"]}},"required":["data"]}}}},"400":{"description":"Invalid workflow graph","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/output-schema/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1},"currentSchema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"context":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true}}},"graph":{"type":"object","properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string","minLength":1},"description":{"type":"string","minLength":1}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string","minLength":1},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string","minLength":1}},"required":["id","description"]},"minItems":1},"model":{"type":"string","minLength":1}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]}},"required":["loopType","collection"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string","minLength":1}]}},"required":["loopType","iterations"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}},"required":["collection"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"nodeId":{"type":"string"}}}},"required":["prompt"]}}}},"responses":{"200":{"description":"Generated structured output schema","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"schema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["schema"]}},"required":["data"]}}}},"400":{"description":"Invalid schema request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Schema generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/instructions/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1},"currentInstructions":{"type":"string","nullable":true},"context":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true}}},"graph":{"type":"object","properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string","minLength":1},"description":{"type":"string","minLength":1}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string","minLength":1},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string","minLength":1}},"required":["id","description"]},"minItems":1},"model":{"type":"string","minLength":1}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]}},"required":["loopType","collection"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string","minLength":1}]}},"required":["loopType","iterations"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}]},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}},"required":["collection"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"nodeId":{"type":"string"}}}},"required":["prompt"]}}}},"responses":{"200":{"description":"Generated workflow agent node instructions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"instructions":{"type":"string","minLength":1}},"required":["instructions"]}},"required":["data"]}}}},"502":{"description":"Instructions generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"expectedUpdatedAt":{"type":"string","description":"Required when updating graph. Must match the agent updatedAt value read by the client."},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string","enum":["active","paused"]}},"additionalProperties":false}}}},"responses":{"200":{"description":"Agent updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid workflow graph","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Agent workflow graph changed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Agent deleted"},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/clone":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}}}}}},"responses":{"201":{"description":"Agent cloned","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/lock":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent workflow graph locked","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/unlock":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Agent workflow graph unlocked","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/versions/publish":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Current agent configuration published","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid workflow graph","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/versions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List of agent versions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string"},"version":{"type":"integer","minimum":1},"name":{"type":"string"},"summary":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"templateId":{"type":"string","nullable":true},"createdByMembershipId":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["membershipId","userId","firstName","lastName","email"]},"isLive":{"type":"boolean"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","version","name","summary","description","instructions","executionMode","graph","tools","triggers","templateId","createdByMembershipId","createdBy","isLive","createdAt","updatedAt"]}}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/versions/{version}/restore":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"version","in":"path"}],"responses":{"200":{"description":"Agent version restored to the current draft","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent or version not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Restored agent version has an unavailable email address","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/versions/{version}/promote":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1},"required":true,"name":"version","in":"path"}],"responses":{"200":{"description":"Agent version promoted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"executionMode":{"type":"string","enum":["legacy_instruction","workflow"]},"graph":{"type":"object","nullable":true,"properties":{"nodes":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["start"]},"data":{"type":"object","properties":{"inputFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]}}}}},"required":["id","position","type"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["schedule_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"schedule":{"oneOf":[{"type":"object","properties":{"frequency":{"type":"string","enum":["hourly"]},"minute":{"type":"integer","minimum":0,"maximum":59},"timezone":{"type":"string","minLength":1}},"required":["frequency","minute","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["daily"]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfWeek","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string","minLength":1}},"required":["frequency","dayOfMonth","time","timezone"]},{"type":"object","properties":{"frequency":{"type":"string","enum":["custom"]},"cron":{"type":"string","minLength":1},"timezone":{"type":"string","minLength":1}},"required":["frequency","cron","timezone"]}]}},"required":["schedule"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["event_trigger"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"provider":{"type":"string","enum":["rulebase","linear"]},"event":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["ticket.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string","minLength":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.issue.updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear.comment.created"]}},"required":["type"]}]}},"required":["provider","event"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["agent"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"instructions":{"type":"string"},"model":{"type":"string","minLength":1},"skillIds":{"type":"array","items":{"type":"string","minLength":1}},"tools":{"type":"array","items":{"type":"object","properties":{"instanceId":{"type":"string","minLength":1},"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"mode":{"type":"string","enum":["auto","required"],"default":"auto"},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["instanceId","toolId","operationId"]},"default":[]},"outputSchema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name","instructions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["tool"]},"data":{"type":"object","properties":{"toolId":{"type":"string","minLength":1},"operationId":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"connectionId":{"type":"string","minLength":1},"params":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["toolId","operationId"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["note"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"body":{"type":"string","default":""}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["condition"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"expression":{"type":"string"},"description":{"type":"string"}},"required":["id","expression"]},"minItems":1}},"required":["conditions"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["router"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"context":{"type":"string"},"routes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"description":{"type":"string"}},"required":["id","description"]},"minItems":1},"model":{"type":"string"}},"required":["context","routes"]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["loop"]},"data":{"oneOf":[{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for_each"]},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""}},"required":["loopType"]},{"type":"object","properties":{"name":{"type":"string","minLength":1},"loopType":{"type":"string","enum":["for"]},"iterations":{"anyOf":[{"type":"integer","minimum":0,"maximum":1000},{"type":"string"}],"default":1}},"required":["loopType"]}]}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["parallel"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"collection":{"anyOf":[{"type":"string"},{"type":"array","items":{"nullable":true}},{"type":"object","additionalProperties":{"nullable":true}}],"default":""},"batchSize":{"type":"integer","minimum":1,"maximum":20,"default":5}}}},"required":["id","position","type","data"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"position":{"type":"object","properties":{"x":{"type":"number"},"y":{"type":"number"}},"required":["x","y"]},"parentId":{"type":"string","minLength":1},"disabled":{"type":"boolean"},"locked":{"type":"boolean"},"type":{"type":"string","enum":["human_in_the_loop"]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1},"displayData":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string","default":""}},"required":["key"]},"default":[]},"notification":{"type":"object","properties":{"type":{"type":"string","enum":["email"],"default":"email"},"recipients":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","minLength":1}},"required":["membershipId"]},"default":[]},"subject":{"type":"string"},"message":{"type":"string"}},"default":{"type":"email","recipients":[]}},"resumeFields":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"pattern":"^[a-zA-Z_][a-zA-Z0-9_-]*$"},"type":{"type":"string","enum":["string","number","boolean","array","object"]},"description":{"type":"string","minLength":1},"defaultValue":{"nullable":true}},"required":["name","type"]},"default":[]}}}},"required":["id","position","type","data"]}]}},"edges":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"sourceHandle":{"type":"string","default":"out"},"target":{"type":"string","minLength":1},"targetHandle":{"type":"string","default":"in"}},"required":["id","source","target"]}}},"required":["nodes","edges"]},"tools":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["rulebase"]},"workspaceData":{"type":"string","enum":["none","read","write"],"default":"none"},"webSearch":{"type":"boolean","default":false},"researchSources":{"type":"array","items":{"type":"string","enum":["opencorporates","secretary_of_state","ein_lookup","ofac_sdn","ofac_consolidated","pacer","ucc_search","news_search","linkedin","web_search_general","whois"]}}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack"]},"connectionId":{"type":"string"},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","access"]},"default":[]}},"required":["type","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["email"]},"recipients":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"name":{"type":"string"}},"required":["address"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["microsoft_teams"]},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"access":{"type":"string","enum":["read","write"]}},"required":["channelId","name","access"]},"default":[]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["snowflake"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"integrationUid":{"type":"string","enum":["zendesk","freshdesk","front","jira","linear","intercom","salesforce","aircall","google_drive","google_sheets","looker_studio","alloy","unit21","hubspot","notion","persona"]},"connectionId":{"type":"string","minLength":1},"config":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","integrationUid","connectionId"]},{"type":"object","properties":{"type":{"type":"string","enum":["mcp_server"]},"name":{"type":"string","minLength":1},"transport":{"type":"string","enum":["url","command"]},"serverUrl":{"type":"string","format":"uri"},"command":{"type":"string","minLength":1},"httpHeaders":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"value":{"type":"string"}},"required":["key","value"]}},"connectionId":{"type":"string","minLength":1}},"required":["type","name","transport"]},{"type":"object","properties":{"type":{"type":"string","enum":["openapi"]},"connectionId":{"type":"string","minLength":1},"schemaFile":{"type":"string"},"schemaContent":{"type":"string"}},"required":["type"]}]}},"triggers":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["schedule"]},"frequency":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["hourly"]},"interval":{"type":"integer","minimum":1,"maximum":23,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["daily"]},"interval":{"type":"integer","minimum":1,"maximum":30,"default":1}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["weekly"]},"days":{"type":"array","items":{"type":"string","enum":["mon","tue","wed","thu","fri","sat","sun"]},"minItems":1}},"required":["type","days"]},{"type":"object","properties":{"type":{"type":"string","enum":["monthly"]},"dayOfMonth":{"type":"integer","minimum":1,"maximum":31}},"required":["type","dayOfMonth"]}]},"time":{"type":"string","pattern":"^([01]\\d|2[0-3]):([0-5]\\d)$"},"timezone":{"type":"string"}},"required":["type","frequency"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_closed"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["ticket_solved"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["sales_call_ended"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_created"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["jira_issue_status_updated"]},"requestTypeId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_issue_updated"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["linear_comment_created"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["email_received"]},"address":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["slack_message_received"]},"channelId":{"type":"string"}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["webhook"]},"endpoint":{"type":"string"}},"required":["type"]}]}},"status":{"type":"string"},"owner":{"type":"string","nullable":true},"templateId":{"type":"string","nullable":true},"liveVersion":{"type":"integer","minimum":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","instructions","executionMode","graph","tools","triggers","status","owner","templateId","liveVersion","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Agent or version not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/knowledge-base-documents":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["agent_node"]},"required":true,"name":"ownerType","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":true,"name":"ownerId","in":"query"}],"responses":{"200":{"description":"Knowledge base documents for an agent owner","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["agent_node"]},"ownerId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","title","content","createdAt","updatedAt"]}}},"required":["data"]}}}},"400":{"description":"Invalid knowledge base document owner","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ownerType":{"type":"string","enum":["agent_node"]},"ownerId":{"type":"string","minLength":1,"maxLength":500},"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000}},"required":["ownerType","ownerId","title","content"]}}}},"responses":{"201":{"description":"Knowledge base document created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["agent_node"]},"ownerId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","title","content","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid knowledge base document owner","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/knowledge-base-documents/{documentId}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000}}}}}},"responses":{"200":{"description":"Knowledge base document updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["agent_node"]},"ownerId":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","title","content","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Knowledge base document deleted"},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/runs":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","nullable":true},"required":false,"name":"since","in":"query"}],"responses":{"200":{"description":"List of agent runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"scheduledFor":{"type":"string"},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"output":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"charts":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"source":{"type":"string","enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","enum":["average","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","enum":["line_chart","bar_chart","stacked_bar_chart","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"date_range_days":{"type":"integer","minimum":1,"maximum":365},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"type":{"type":"string"},"score_option_types":{"type":"array","items":{"type":"string"}},"scorecard_criterion_ids":{"type":"array","items":{"type":"string"}},"customer_issue_types":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"required":["title","source","metric_aggregation","display_type"]}},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheetId":{"type":"string"},"sheetUrl":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["created","updated"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","sheetId","sheetUrl","name","action","createdAt","updatedAt"]},"default":[]},"progress":{"type":"object","nullable":true,"properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"iterationPath":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"output":{"nullable":true},"submittedBy":{"type":"object","properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"creditsUsed":{"type":"number","nullable":true}},"required":["id","nodeId","iterationPath","label","status"]}},"activities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"toolName":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed"]},"input":{"nullable":true},"output":{"nullable":true},"error":{"type":"string"}},"required":["id","label","toolName","status"]}},"currentLabel":{"type":"string","nullable":true}},"required":["steps","activities","currentLabel"]},"createdByMembershipId":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"creditsUsed":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","agentId","status","source","scheduledFor","startedAt","finishedAt","input","output","error","createdByMembershipId","createdBy","createdAt"]}}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"sourceNodeId":{"type":"string","minLength":1,"description":"Optional graph node id to use when manually running a workflow graph. The node must not have incoming connections."},"input":{"type":"string","nullable":true,"description":"Optional run input, usually JSON encoded for start fields."}}}}}},"responses":{"201":{"description":"Agent run queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"scheduledFor":{"type":"string"},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"output":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"charts":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"source":{"type":"string","enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","enum":["average","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","enum":["line_chart","bar_chart","stacked_bar_chart","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"date_range_days":{"type":"integer","minimum":1,"maximum":365},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"type":{"type":"string"},"score_option_types":{"type":"array","items":{"type":"string"}},"scorecard_criterion_ids":{"type":"array","items":{"type":"string"}},"customer_issue_types":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"required":["title","source","metric_aggregation","display_type"]}},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheetId":{"type":"string"},"sheetUrl":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["created","updated"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","sheetId","sheetUrl","name","action","createdAt","updatedAt"]},"default":[]},"progress":{"type":"object","nullable":true,"properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"iterationPath":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"output":{"nullable":true},"submittedBy":{"type":"object","properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"creditsUsed":{"type":"number","nullable":true}},"required":["id","nodeId","iterationPath","label","status"]}},"activities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"toolName":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed"]},"input":{"nullable":true},"output":{"nullable":true},"error":{"type":"string"}},"required":["id","label","toolName","status"]}},"currentLabel":{"type":"string","nullable":true}},"required":["steps","activities","currentLabel"]},"createdByMembershipId":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"creditsUsed":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","agentId","status","source","scheduledFor","startedAt","finishedAt","input","output","error","createdByMembershipId","createdBy","createdAt"]}},"required":["data"]}}}},"400":{"description":"Invalid workflow run request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{agentId}/runs/{runId}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"agentId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Agent run found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agentId":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"scheduledFor":{"type":"string"},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"output":{"type":"string","nullable":true},"error":{"type":"string","nullable":true},"charts":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"source":{"type":"string","enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","enum":["average","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","enum":["line_chart","bar_chart","stacked_bar_chart","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"date_range_days":{"type":"integer","minimum":1,"maximum":365},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"type":{"type":"string"},"score_option_types":{"type":"array","items":{"type":"string"}},"scorecard_criterion_ids":{"type":"array","items":{"type":"string"}},"customer_issue_types":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"required":["title","source","metric_aggregation","display_type"]}},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheetId":{"type":"string"},"sheetUrl":{"type":"string"},"name":{"type":"string"},"action":{"type":"string","enum":["created","updated"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","sheetId","sheetUrl","name","action","createdAt","updatedAt"]},"default":[]},"progress":{"type":"object","nullable":true,"properties":{"steps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"nodeId":{"type":"string"},"iterationPath":{"type":"string"},"label":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"output":{"nullable":true},"submittedBy":{"type":"object","properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"creditsUsed":{"type":"number","nullable":true}},"required":["id","nodeId","iterationPath","label","status"]}},"activities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"toolName":{"type":"string"},"status":{"type":"string","enum":["running","completed","failed"]},"input":{"nullable":true},"output":{"nullable":true},"error":{"type":"string"}},"required":["id","label","toolName","status"]}},"currentLabel":{"type":"string","nullable":true}},"required":["steps","activities","currentLabel"]},"createdByMembershipId":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"},"avatarUrl":{"type":"string","nullable":true}},"required":["membershipId","userId","firstName","lastName","email","avatarUrl"]},"creditsUsed":{"type":"number","nullable":true},"createdAt":{"type":"string"}},"required":["id","agentId","status","source","scheduledFor","startedAt","finishedAt","input","output","error","createdByMembershipId","createdBy","createdAt"]}},"required":["data"]}}}},"404":{"description":"Agent run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/run":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"202":{"description":"Webhook accepted and agent run queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accepted":{"type":"boolean"},"runId":{"type":"string","nullable":true}},"required":["accepted","runId"]}},"required":["data"]}}}},"404":{"description":"Agent not found or webhook trigger not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/campaigns":{"get":{"tags":["Campaigns"],"responses":{"200":{"description":"Organization campaigns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","active","in_progress","paused","scheduled","complete"]},"objective":{"type":"string","nullable":true},"approach":{"type":"string","nullable":true},"planTasks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"completed":{"type":"boolean"}},"required":["title","description","completed"]}},"createdBy":{"type":"object","properties":{"name":{"type":"string"},"initials":{"type":"string"}},"required":["name","initials"]},"dueLabel":{"type":"string"},"contactedCount":{"type":"integer"},"totalCount":{"type":"integer"},"percentComplete":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","status","objective","approach","planTasks","createdBy","dueLabel","contactedCount","totalCount","percentComplete","createdAt","updatedAt"]}}},"required":["data"]}}}}}}},"/campaigns/{campaignId}":{"get":{"tags":["Campaigns"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"campaignId","in":"path"}],"responses":{"200":{"description":"Campaign detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","active","in_progress","paused","scheduled","complete"]},"objective":{"type":"string","nullable":true},"approach":{"type":"string","nullable":true},"planTasks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"completed":{"type":"boolean"}},"required":["title","description","completed"]}},"createdBy":{"type":"object","properties":{"name":{"type":"string"},"initials":{"type":"string"}},"required":["name","initials"]},"dueLabel":{"type":"string"},"contactedCount":{"type":"integer"},"totalCount":{"type":"integer"},"percentComplete":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","status","objective","approach","planTasks","createdBy","dueLabel","contactedCount","totalCount","percentComplete","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"tags":["Campaigns"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"campaignId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"campaign":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"objective":{"type":"string","maxLength":500},"approach":{"type":"string","maxLength":2000},"plan_tasks":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string","minLength":1},"description":{"type":"string","minLength":1}},"required":["title","description"]}},"display_columns":{"type":"array","items":{"type":"string","minLength":1}},"status":{"type":"string","enum":["active","in_progress","paused","scheduled","complete"]}}}},"required":["campaign"]}}}},"responses":{"200":{"description":"Updated campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"status":{"type":"string","enum":["draft","active","in_progress","paused","scheduled","complete"]},"objective":{"type":"string","nullable":true},"approach":{"type":"string","nullable":true},"planTasks":{"type":"array","nullable":true,"items":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"},"completed":{"type":"boolean"}},"required":["title","description","completed"]}},"createdBy":{"type":"object","properties":{"name":{"type":"string"},"initials":{"type":"string"}},"required":["name","initials"]},"dueLabel":{"type":"string"},"contactedCount":{"type":"integer"},"totalCount":{"type":"integer"},"percentComplete":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","description","status","objective","approach","planTasks","createdBy","dueLabel","contactedCount","totalCount","percentComplete","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Campaigns"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"campaignId","in":"path"}],"responses":{"200":{"description":"Deleted campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/campaigns/{campaignId}/companies":{"get":{"tags":["Campaigns"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"campaignId","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"Companies in a campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"domainNames":{"type":"array","items":{"type":"string"}},"ubos":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"contacts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"docsRetrieved":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}},"documentsMissing":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"}},"required":["id","label"]}},"lastContactedAt":{"type":"string","nullable":true},"taskId":{"type":"string","nullable":true,"format":"uuid"},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]}},"required":["id","name","logoUrl","domainNames","ubos","contacts","docsRetrieved","documentsMissing","lastContactedAt","taskId","status"]}},"meta":{"type":"object","properties":{"displayColumns":{"type":"array","items":{"type":"string"}},"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["displayColumns","page"]}},"required":["data","meta"]}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/campaigns/{campaignId}/start":{"post":{"tags":["Campaigns"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"campaignId","in":"path"}],"responses":{"200":{"description":"Started campaign","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"campaign_id":{"type":"string","format":"uuid"}},"required":["success","campaign_id"]}},"required":["data"]}}}},"400":{"description":"Campaign cannot be started","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Campaign not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/export":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"filters","in":"query"}],"responses":{"200":{"description":"Customers CSV export","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"company_field_filters","in":"query"},{"schema":{"type":"string","enum":["field_values"]},"required":false,"name":"include","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"sort","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"List companies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"domainNames":{"type":"array","items":{"type":"string"}},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"fieldValues":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organizationDataSourceId":{"type":"string","nullable":true},"editable":{"type":"boolean"},"value":{"nullable":true}},"required":["fieldId","label","description","name","valueType","displayFormat","options","organizationDataSourceId","editable"]}}},"required":["id","name","shortDescription","description","domainNames","logoUrl","externalId","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid company field filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"shortDescription":{"type":"string","nullable":true,"maxLength":255},"description":{"type":"string","nullable":true,"maxLength":2000},"externalId":{"type":"string","nullable":true,"maxLength":255}},"required":["name"]}}}},"responses":{"201":{"description":"Create company","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"domainNames":{"type":"array","items":{"type":"string"}},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","shortDescription","description","domainNames","logoUrl","externalId","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/onboarding_case":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"responses":{"200":{"description":"Existing company onboarding case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"status":{"type":"string","enum":["open","waiting","blocked","pending_approval","completed","closed","failed"]},"statusSummary":{"type":"string","nullable":true},"statusSummaryUpdatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"requirements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"key":{"type":"string","nullable":true},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_review","satisfied","needs_correction","waived"]},"requestedAt":{"type":"string","nullable":true},"lastRequestedAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"satisfiedAt":{"type":"string","nullable":true},"rejectionReason":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latestSubmission":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"caseRequirementId":{"type":"string"},"storageBlobId":{"type":"string"},"source":{"type":"string","enum":["email","intercom","front","drive","upload","api"]},"externalUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["received","accepted","rejected","superseded"]},"reviewReason":{"type":"string","nullable":true,"enum":["unreadable","expired","mismatched","wrong_document"]},"receivedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"storageBlob":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"byteSize":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","filename","contentType","byteSize","createdAt","updatedAt"]}},"required":["id","organizationId","onboardingCaseId","caseRequirementId","storageBlobId","source","externalUrl","status","reviewReason","receivedAt","reviewedAt","createdAt","updatedAt","storageBlob"]}},"required":["id","organizationId","onboardingCaseId","key","label","status","requestedAt","lastRequestedAt","submittedAt","reviewedAt","satisfiedAt","rejectionReason","createdAt","updatedAt","latestSubmission"]}}},"required":["id","organizationId","companyId","status","statusSummary","statusSummaryUpdatedAt","createdAt","updatedAt","requirements"]}},"required":["data"]}}}},"201":{"description":"Create company onboarding case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"status":{"type":"string","enum":["open","waiting","blocked","pending_approval","completed","closed","failed"]},"statusSummary":{"type":"string","nullable":true},"statusSummaryUpdatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"requirements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"key":{"type":"string","nullable":true},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_review","satisfied","needs_correction","waived"]},"requestedAt":{"type":"string","nullable":true},"lastRequestedAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"satisfiedAt":{"type":"string","nullable":true},"rejectionReason":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latestSubmission":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"caseRequirementId":{"type":"string"},"storageBlobId":{"type":"string"},"source":{"type":"string","enum":["email","intercom","front","drive","upload","api"]},"externalUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["received","accepted","rejected","superseded"]},"reviewReason":{"type":"string","nullable":true,"enum":["unreadable","expired","mismatched","wrong_document"]},"receivedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"storageBlob":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"byteSize":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","filename","contentType","byteSize","createdAt","updatedAt"]}},"required":["id","organizationId","onboardingCaseId","caseRequirementId","storageBlobId","source","externalUrl","status","reviewReason","receivedAt","reviewedAt","createdAt","updatedAt","storageBlob"]}},"required":["id","organizationId","onboardingCaseId","key","label","status","requestedAt","lastRequestedAt","submittedAt","reviewedAt","satisfiedAt","rejectionReason","createdAt","updatedAt","latestSubmission"]}}},"required":["id","organizationId","companyId","status","statusSummary","statusSummaryUpdatedAt","createdAt","updatedAt","requirements"]}},"required":["data"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"responses":{"200":{"description":"Get company","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"domainNames":{"type":"array","items":{"type":"string"}},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"fieldValues":{"type":"array","items":{"type":"object","properties":{"fieldId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organizationDataSourceId":{"type":"string","nullable":true},"editable":{"type":"boolean"},"value":{"nullable":true}},"required":["fieldId","label","description","name","valueType","displayFormat","options","organizationDataSourceId","editable"]}},"signalValues":{"type":"array","items":{"type":"object","properties":{"signalId":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"companyFieldId":{"type":"string","nullable":true},"companyField":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["id","label","name","valueType","displayFormat","options"]},"valueType":{"type":"string"},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"displayGroup":{"type":"string"},"displayOrder":{"type":"integer"},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"value":{"nullable":true},"computedAt":{"type":"string","nullable":true}},"required":["signalId","key","label","description","companyFieldId","companyField","valueType","displayFormat","displayGroup","displayOrder","options","computedAt"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isUbo":{"type":"boolean"}},"required":["id","name","email","isUbo"]}},"onboardingCase":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"status":{"type":"string","enum":["open","waiting","blocked","pending_approval","completed","closed","failed"]},"statusSummary":{"type":"string","nullable":true},"statusSummaryUpdatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"requirements":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"key":{"type":"string","nullable":true},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_review","satisfied","needs_correction","waived"]},"requestedAt":{"type":"string","nullable":true},"lastRequestedAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"satisfiedAt":{"type":"string","nullable":true},"rejectionReason":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latestSubmission":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"caseRequirementId":{"type":"string"},"storageBlobId":{"type":"string"},"source":{"type":"string","enum":["email","intercom","front","drive","upload","api"]},"externalUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["received","accepted","rejected","superseded"]},"reviewReason":{"type":"string","nullable":true,"enum":["unreadable","expired","mismatched","wrong_document"]},"receivedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"storageBlob":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"byteSize":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","filename","contentType","byteSize","createdAt","updatedAt"]}},"required":["id","organizationId","onboardingCaseId","caseRequirementId","storageBlobId","source","externalUrl","status","reviewReason","receivedAt","reviewedAt","createdAt","updatedAt","storageBlob"]}},"required":["id","organizationId","onboardingCaseId","key","label","status","requestedAt","lastRequestedAt","submittedAt","reviewedAt","satisfiedAt","rejectionReason","createdAt","updatedAt","latestSubmission"]}}},"required":["id","organizationId","companyId","status","statusSummary","statusSummaryUpdatedAt","createdAt","updatedAt","requirements"]}},"required":["id","name","shortDescription","description","domainNames","logoUrl","externalId","createdAt","updatedAt","fieldValues","signalValues","clients","onboardingCase"]}},"required":["data"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"shortDescription":{"type":"string","nullable":true,"maxLength":255},"description":{"type":"string","nullable":true,"maxLength":2000},"domainNames":{"type":"array","items":{"type":"string","minLength":1,"maxLength":255},"maxItems":50}}}}}},"responses":{"200":{"description":"Update company","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"shortDescription":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"domainNames":{"type":"array","items":{"type":"string"}},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","shortDescription","description","domainNames","logoUrl","externalId","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"No fields to update","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"responses":{"204":{"description":"Delete company"},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/events":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"responses":{"200":{"description":"Get company events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"eventType":{"type":"string","enum":["company_created","comment_added","field_value_changed","task_event"]},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"commentId":{"type":"string","nullable":true},"comment":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"bodyHtml":{"type":"string"},"bodyMarkdown":{"type":"string"},"bodyText":{"type":"string","nullable":true},"authorType":{"type":"string","enum":["user","agent","system"]},"authorMembershipId":{"type":"string","nullable":true},"authorAgentId":{"type":"string","nullable":true},"agentRunId":{"type":"string","nullable":true},"authorName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","companyId","bodyHtml","bodyMarkdown","bodyText","authorType","authorMembershipId","authorAgentId","agentRunId","authorName","createdAt","updatedAt"]},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","companyId","eventType","actorType","actorMembershipId","actorAgentId","actorName","commentId","comment","metadata","createdAt"]}}},"required":["data"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/interactions":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"List company interactions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"subject":{"type":"string"},"source_channel":{"type":"string","nullable":true},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]}},"required":["id","started_at","summary","external_id","subject","source_channel","data_source"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/field_values/{fieldId}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"fieldId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"nullable":true}}}}}},"responses":{"200":{"description":"Update company field value","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"fieldId":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organizationDataSourceId":{"type":"string","nullable":true},"editable":{"type":"boolean"},"value":{"nullable":true}},"required":["fieldId","label","description","name","valueType","displayFormat","options","organizationDataSourceId","editable"]}},"required":["data"]}}}},"400":{"description":"Invalid company field value","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Company field is read-only","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Company or field not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/clients":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"email":{"type":"string","maxLength":255,"format":"email"}},"required":["name","email"]}}}},"responses":{"201":{"description":"Add or link a company client","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isUbo":{"type":"boolean"}},"required":["id","name","email","isUbo"]}},"required":["data"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/clients/{clientId}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"clientId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"isUbo":{"type":"boolean"}},"required":["isUbo"]}}}},"responses":{"200":{"description":"Update company client","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"isUbo":{"type":"boolean"}},"required":["id","name","email","isUbo"]}},"required":["data"]}}}},"404":{"description":"Company client not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"clientId","in":"path"}],"responses":{"204":{"description":"Unlink company client"},"404":{"description":"Company client not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/comments":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bodyMarkdown":{"type":"string","minLength":1,"maxLength":100000}},"required":["bodyMarkdown"]}}}},"responses":{"201":{"description":"Company comment created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"bodyHtml":{"type":"string"},"bodyMarkdown":{"type":"string"},"bodyText":{"type":"string","nullable":true},"authorType":{"type":"string","enum":["user","agent","system"]},"authorMembershipId":{"type":"string","nullable":true},"authorAgentId":{"type":"string","nullable":true},"agentRunId":{"type":"string","nullable":true},"authorName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","companyId","bodyHtml","bodyMarkdown","bodyText","authorType","authorMembershipId","authorAgentId","agentRunId","authorName","createdAt","updatedAt"]},"event":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"eventType":{"type":"string","enum":["company_created","comment_added","field_value_changed","task_event"]},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"commentId":{"type":"string","nullable":true},"comment":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"companyId":{"type":"string"},"bodyHtml":{"type":"string"},"bodyMarkdown":{"type":"string"},"bodyText":{"type":"string","nullable":true},"authorType":{"type":"string","enum":["user","agent","system"]},"authorMembershipId":{"type":"string","nullable":true},"authorAgentId":{"type":"string","nullable":true},"agentRunId":{"type":"string","nullable":true},"authorName":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","companyId","bodyHtml","bodyMarkdown","bodyText","authorType","authorMembershipId","authorAgentId","agentRunId","authorName","createdAt","updatedAt"]},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","companyId","eventType","actorType","actorMembershipId","actorAgentId","actorName","commentId","comment","metadata","createdAt"]},"queuedAssistantReply":{"type":"boolean"}},"required":["data","event","queuedAssistantReply"]}}}},"404":{"description":"Company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/case_requirements":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":255}},"required":["label"]}}}},"responses":{"201":{"description":"Create company onboarding requirement","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"key":{"type":"string","nullable":true},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_review","satisfied","needs_correction","waived"]},"requestedAt":{"type":"string","nullable":true},"lastRequestedAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"satisfiedAt":{"type":"string","nullable":true},"rejectionReason":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latestSubmission":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"caseRequirementId":{"type":"string"},"storageBlobId":{"type":"string"},"source":{"type":"string","enum":["email","intercom","front","drive","upload","api"]},"externalUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["received","accepted","rejected","superseded"]},"reviewReason":{"type":"string","nullable":true,"enum":["unreadable","expired","mismatched","wrong_document"]},"receivedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"storageBlob":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"byteSize":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","filename","contentType","byteSize","createdAt","updatedAt"]}},"required":["id","organizationId","onboardingCaseId","caseRequirementId","storageBlobId","source","externalUrl","status","reviewReason","receivedAt","reviewedAt","createdAt","updatedAt","storageBlob"]}},"required":["id","organizationId","onboardingCaseId","key","label","status","requestedAt","lastRequestedAt","submittedAt","reviewedAt","satisfiedAt","rejectionReason","createdAt","updatedAt","latestSubmission"]}},"required":["data"]}}}},"404":{"description":"Company or onboarding case not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/case_requirements/{requirementId}/submissions":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"requirementId","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"201":{"description":"Upload evidence for an onboarding requirement","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"key":{"type":"string","nullable":true},"label":{"type":"string"},"status":{"type":"string","enum":["pending","in_review","satisfied","needs_correction","waived"]},"requestedAt":{"type":"string","nullable":true},"lastRequestedAt":{"type":"string","nullable":true},"submittedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"satisfiedAt":{"type":"string","nullable":true},"rejectionReason":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"latestSubmission":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"onboardingCaseId":{"type":"string"},"caseRequirementId":{"type":"string"},"storageBlobId":{"type":"string"},"source":{"type":"string","enum":["email","intercom","front","drive","upload","api"]},"externalUrl":{"type":"string","nullable":true},"status":{"type":"string","enum":["received","accepted","rejected","superseded"]},"reviewReason":{"type":"string","nullable":true,"enum":["unreadable","expired","mismatched","wrong_document"]},"receivedAt":{"type":"string","nullable":true},"reviewedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"storageBlob":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"filename":{"type":"string"},"contentType":{"type":"string","nullable":true},"byteSize":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","filename","contentType","byteSize","createdAt","updatedAt"]}},"required":["id","organizationId","onboardingCaseId","caseRequirementId","storageBlobId","source","externalUrl","status","reviewReason","receivedAt","reviewedAt","createdAt","updatedAt","storageBlob"]}},"required":["id","organizationId","onboardingCaseId","key","label","status","requestedAt","lastRequestedAt","submittedAt","reviewedAt","satisfiedAt","rejectionReason","createdAt","updatedAt","latestSubmission"]}},"required":["data"]}}}},"404":{"description":"Company or requirement not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid submission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/case_requirements/{requirementId}/submissions/{submissionId}/download":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"requirementId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"submissionId","in":"path"}],"responses":{"200":{"description":"Requirement submission download","content":{"application/octet-stream":{"schema":{"type":"string"}}}},"404":{"description":"Submission not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/companies/{companyId}/comments/{commentId}":{"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"companyId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"commentId","in":"path"}],"responses":{"204":{"description":"Company comment deleted"},"404":{"description":"Company comment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/company-signals":{"get":{"responses":{"200":{"description":"List company signal display configurations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"companyFieldId":{"type":"string","nullable":true},"companyField":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["id","label","name","valueType","displayFormat","options"]},"valueType":{"type":"string","enum":["string","boolean","date","datetime","number","enum"]},"displayGroup":{"type":"string","enum":["top_metrics","account_risk_posture","stall_state","stall_reason","details"]},"displayOrder":{"type":"integer"},"enabled":{"type":"boolean"},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","label","description","companyFieldId","companyField","valueType","displayGroup","displayOrder","enabled","options","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","nullable":true,"maxLength":2000},"companyFieldId":{"type":"string","minLength":1},"displayGroup":{"type":"string","enum":["top_metrics","account_risk_posture","stall_state","stall_reason","details"],"default":"details"},"displayOrder":{"type":"integer","default":0},"enabled":{"type":"boolean","default":true}},"required":["label","companyFieldId"]}}}},"responses":{"201":{"description":"Company signal display configuration created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"companyFieldId":{"type":"string","nullable":true},"companyField":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["id","label","name","valueType","displayFormat","options"]},"valueType":{"type":"string","enum":["string","boolean","date","datetime","number","enum"]},"displayGroup":{"type":"string","enum":["top_metrics","account_risk_posture","stall_state","stall_reason","details"]},"displayOrder":{"type":"integer"},"enabled":{"type":"boolean"},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","label","description","companyFieldId","companyField","valueType","displayGroup","displayOrder","enabled","options","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Company field not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Signal key already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/company-signals/{signalId}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"signalId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z][a-z0-9_]*$"},"label":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","nullable":true,"maxLength":2000},"companyFieldId":{"type":"string","minLength":1},"displayGroup":{"type":"string","enum":["top_metrics","account_risk_posture","stall_state","stall_reason","details"],"default":"details"},"displayOrder":{"type":"integer","default":0},"enabled":{"type":"boolean","default":true}}}}}},"responses":{"200":{"description":"Company signal display configuration updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"key":{"type":"string"},"label":{"type":"string"},"description":{"type":"string","nullable":true},"companyFieldId":{"type":"string","nullable":true},"companyField":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"valueType":{"type":"string","nullable":true},"displayFormat":{"type":"string","nullable":true,"enum":["currency","percentage"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["id","label","name","valueType","displayFormat","options"]},"valueType":{"type":"string","enum":["string","boolean","date","datetime","number","enum"]},"displayGroup":{"type":"string","enum":["top_metrics","account_risk_posture","stall_state","stall_reason","details"]},"displayOrder":{"type":"integer"},"enabled":{"type":"boolean"},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","key","label","description","companyFieldId","companyField","valueType","displayGroup","displayOrder","enabled","options","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Signal or company field not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Signal key already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"signalId","in":"path"}],"responses":{"204":{"description":"Company signal display configuration deleted"},"404":{"description":"Signal not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workflows/{id}/chats":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List agent chats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","createdAt","updatedAt"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/chats":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"pinned","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["human_qa","agent_monitoring"]},"required":false,"name":"experience","in":"query"}],"responses":{"200":{"description":"List of chats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"membershipId":{"type":"string","nullable":true},"title":{"type":"string"},"experience":{"type":"string","enum":["human_qa","agent_monitoring"]},"pinnedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","membershipId","title","experience","pinnedAt","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/chat-files/{fileId}/download":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"File bytes as an attachment","content":{"application/octet-stream":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"File not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/chats/{chatId}/references":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"chatId","in":"path"}],"responses":{"200":{"description":"Objects the chat has referenced","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"chatId":{"type":"string"},"kind":{"type":"string","enum":["task","conversation","sheet","artifact"]},"objectId":{"type":"string"},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","chatId","kind","objectId","label","metadata","createdAt","updatedAt"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Chat not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"chatId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["task","conversation","sheet","artifact"]},"objectId":{"type":"string","minLength":1},"label":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["kind","objectId"]}}}},"responses":{"200":{"description":"Recorded reference","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"chatId":{"type":"string"},"kind":{"type":"string","enum":["task","conversation","sheet","artifact"]},"objectId":{"type":"string"},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","chatId","kind","objectId","label","metadata","createdAt","updatedAt"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Chat not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/chats/{chatId}/references/{referenceId}":{"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"chatId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"referenceId","in":"path"}],"responses":{"204":{"description":"Reference removed"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Chat or reference not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","description":"Values above 1000 are clamped to 1000","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"Compliance agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_agent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"frequency":{"type":"string","enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"framework_ids":{"type":"array","items":{"type":"string"}}}}},"required":["compliance_agent"]}}}},"responses":{"201":{"description":"Compliance agent created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_agent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"frequency":{"type":"string","enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"framework_ids":{"type":"array","items":{"type":"string"}}}}},"required":["compliance_agent"]}}}},"responses":{"200":{"description":"Compliance agent updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_agent":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"frequency":{"type":"string","enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"framework_ids":{"type":"array","items":{"type":"string"}}}}},"required":["compliance_agent"]}}}},"responses":{"200":{"description":"Compliance agent updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Compliance agent discarded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/generate":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"compliance_agent_generation[prompt]":{"type":"string"},"compliance_agent_generation[file]":{"nullable":true}},"required":["compliance_agent_generation[prompt]"]}}}},"responses":{"201":{"description":"Compliance agent generated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{id}/generate_risk_factors":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Risk factor generation already settled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"202":{"description":"Risk factor generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{id}/confirm_controls":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_agent":{"type":"object","properties":{"description":{"type":"string","nullable":true}}}}}}}},"responses":{"200":{"description":"Controls confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{id}/confirm_population":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Population confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{id}/confirm_risk_factors":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Risk factors confirmed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"test_risk_scenarios":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"agent_test_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"program_controls":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"program_risk_factors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"program_sampling_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks","test_risk_scenarios","agent_test_columns","program_controls","program_risk_factors","program_sampling_rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/test_risk_scenarios":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"Test risk scenarios","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"test_risk_scenario":{"type":"object","properties":{"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}},"required":["description"]}},"required":["test_risk_scenario"]}}}},"responses":{"201":{"description":"Test risk scenario created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/test_risk_scenarios/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Test risk scenario","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"test_risk_scenario":{"type":"object","properties":{"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}}},"required":["test_risk_scenario"]}}}},"responses":{"200":{"description":"Test risk scenario updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"test_risk_scenario":{"type":"object","properties":{"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}}}}},"required":["test_risk_scenario"]}}}},"responses":{"200":{"description":"Test risk scenario updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"examples":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","description","examples","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Test risk scenario deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/program_risk_factors":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"Program risk factors","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_risk_factor":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}},"required":["title","description"]}},"required":["program_risk_factor"]}}}},"responses":{"201":{"description":"Program risk factor created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/program_risk_factors/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Program risk factor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_risk_factor":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}}},"required":["program_risk_factor"]}}}},"responses":{"200":{"description":"Program risk factor updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_risk_factor":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string"}}}},"required":["program_risk_factor"]}}}},"responses":{"200":{"description":"Program risk factor updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Program risk factor deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent_test_columns/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_test_column":{"type":"object","properties":{"label":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","record","url"]}}}},"required":["agent_test_column"]}}}},"responses":{"200":{"description":"Agent test column updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_test_column":{"type":"object","properties":{"label":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","record","url"]}}}},"required":["agent_test_column"]}}}},"responses":{"200":{"description":"Agent test column updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"width":{"type":"integer"},"options":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","position","width","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Agent test column deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/controls":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string","description":"Comma-separated framework prefix ids; only controls linked to at least one of them are returned"},"required":false,"name":"filter[framework_ids]","in":"query"}],"responses":{"200":{"description":"Controls for the current organization, ordered by name","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/controls/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"control":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true}}}},"required":["control"]}}}},"responses":{"200":{"description":"Control updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"control":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true}}}},"required":["control"]}}}},"responses":{"200":{"description":"Control updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Control deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/program_controls":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Program controls","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_control":{"type":"object","properties":{"control_id":{"type":"string","nullable":true},"control_name":{"type":"string","nullable":true}}}},"required":["program_control"]}}}},"responses":{"201":{"description":"Program control created (or already present)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"control":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","created_at","updated_at"]},"program_test_questions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}}},"required":["id","control","program_test_questions"]}},"required":["data"]}}}},"400":{"description":"Parameter missing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/program_controls/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Program control deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/program_controls/{program_control_id}/program_test_questions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"program_control_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Program test questions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"program_control_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_test_question":{"type":"object","properties":{"question":{"type":"string","nullable":true}}}},"required":["program_test_question"]}}}},"responses":{"201":{"description":"Program test question created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/program_test_questions/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_test_question":{"type":"object","properties":{"question":{"type":"string","nullable":true}}}},"required":["program_test_question"]}}}},"responses":{"200":{"description":"Program test question updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_test_question":{"type":"object","properties":{"question":{"type":"string","nullable":true}}}},"required":["program_test_question"]}}}},"responses":{"200":{"description":"Program test question updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"question":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","question","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Program test question deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/program_sampling_rules":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Program sampling rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_sampling_rule":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string","nullable":true},"value":{"nullable":true}}}},"sampling_strategy":{"type":"object","nullable":true,"properties":{"type":{"type":"string","nullable":true},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"tiers":{"type":"array","nullable":true,"items":{"type":"object","properties":{"min":{"type":"number","nullable":true},"max":{"type":"number","nullable":true},"value":{"type":"number","nullable":true},"value_type":{"type":"string","nullable":true}}}}}}}}},"required":["program_sampling_rule"]}}}},"responses":{"201":{"description":"Program sampling rule created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/program_sampling_rules/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_sampling_rule":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string","nullable":true},"value":{"nullable":true}}}},"sampling_strategy":{"type":"object","nullable":true,"properties":{"type":{"type":"string","nullable":true},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"tiers":{"type":"array","nullable":true,"items":{"type":"object","properties":{"min":{"type":"number","nullable":true},"max":{"type":"number","nullable":true},"value":{"type":"number","nullable":true},"value_type":{"type":"string","nullable":true}}}}}}}}},"required":["program_sampling_rule"]}}}},"responses":{"200":{"description":"Program sampling rule updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"program_sampling_rule":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string","nullable":true},"value":{"nullable":true}}}},"sampling_strategy":{"type":"object","nullable":true,"properties":{"type":{"type":"string","nullable":true},"value":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"tiers":{"type":"array","nullable":true,"items":{"type":"object","properties":{"min":{"type":"number","nullable":true},"max":{"type":"number","nullable":true},"value":{"type":"number","nullable":true},"value_type":{"type":"string","nullable":true}}}}}}}}},"required":["program_sampling_rule"]}}}},"responses":{"200":{"description":"Program sampling rule updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/program_sampling_rule_condition"}},"sampling_strategy":{"$ref":"#/components/schemas/program_sampling_rule_sampling_strategy"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","conditions","sampling_strategy","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Program sampling rule deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/compliance_tests":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Compliance tests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_test":{"type":"object","properties":{"name":{"type":"string","nullable":true},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true}}}},"required":["compliance_test"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_tests/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance test","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_test":{"type":"object","properties":{"name":{"type":"string","nullable":true},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true}}}},"required":["compliance_test"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Discarded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_tests/{compliance_test_id}/compliance_test_sheets":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_test_id","in":"path"}],"responses":{"201":{"description":"Sheet created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}},"sheet_columns":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort","sheet_columns"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_tests/{compliance_test_id}/test_reports":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_test_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Test reports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string","nullable":true},"recommendations":{"type":"string","nullable":true},"interactions_count":{"type":"integer"},"generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/test_report_finding"}},"control_results_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/test_report_control_result"}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_test":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"required":["id","title","summary","recommendations","interactions_count","generated_at","created_at","updated_at","findings","control_results_breakdown","created_by_membership","compliance_test"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_test_id","in":"path"}],"responses":{"201":{"description":"Test report created; generation runs asynchronously","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string","nullable":true},"recommendations":{"type":"string","nullable":true},"interactions_count":{"type":"integer"},"generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"findings":{"type":"array","items":{"$ref":"#/components/schemas/test_report_finding"}},"control_results_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/test_report_control_result"}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_test":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"start_date":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"population_size":{"type":"integer","nullable":true},"sample_size":{"type":"integer","nullable":true},"sampled_at":{"type":"string","nullable":true},"sampling_started_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"compliance_agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"frequency":{"type":"string","nullable":true,"enum":["weekly","monthly","quarterly"]},"target_type":{"type":"string","enum":["conversation","dispute","compliance_case","compliance_alert"]},"details_confirmed_at":{"type":"string","nullable":true},"population_confirmed_at":{"type":"string","nullable":true},"risk_factors_confirmed_at":{"type":"string","nullable":true},"risk_factors_generation_status":{"type":"string","enum":["pending","in_progress","completed"]},"risk_factors_generation_started_at":{"type":"string","nullable":true},"risk_factors_generation_parts":{"type":"array","items":{"nullable":true}},"risk_scenarios_generated_at":{"type":"string","nullable":true},"test_columns_generated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["id","name","description","frequency","target_type","details_confirmed_at","population_confirmed_at","risk_factors_confirmed_at","risk_factors_generation_status","risk_factors_generation_started_at","risk_factors_generation_parts","risk_scenarios_generated_at","test_columns_generated_at","created_at","updated_at","created_by_membership","frameworks"]},"sheets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"sheet_rows_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"filters":{"type":"array","items":{"nullable":true}},"sort":{"type":"array","items":{"nullable":true}}},"required":["id","name","position","sheet_rows_count","created_at","updated_at","filters","sort"]}}},"required":["id","name","start_date","end_date","population_size","sample_size","sampled_at","sampling_started_at","created_at","updated_at","created_by_membership","compliance_agent","sheets"]}},"required":["id","title","summary","recommendations","interactions_count","generated_at","created_at","updated_at","findings","control_results_breakdown","created_by_membership","compliance_test"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/test_reports/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_agents/{compliance_agent_id}/compliance_policies":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"}],"responses":{"200":{"description":"Compliance policies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"partner_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["id","content","created_at","updated_at","partner_id","title","url","partner"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"compliance_agent_id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"compliance_policy[file]":{"nullable":true},"compliance_policy[content]":{"type":"string"},"compliance_policy[compliance_policy_id]":{"type":"string"}}}}}},"responses":{"201":{"description":"Compliance policy attached","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"partner_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["id","content","created_at","updated_at","partner_id","title","url","partner"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable entity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/veriff":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","minLength":1},"shared_secret":{"type":"string","minLength":1},"base_url":{"type":"string","format":"uri"}},"required":["api_key","shared_secret","base_url"]}}}},"responses":{"200":{"description":"Veriff connection created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid Veriff credentials or configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/complyadvantage":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","minLength":1},"region":{"type":"string","enum":["eu","us","apac"],"default":"eu"}},"required":["api_key"]}}}},"responses":{"200":{"description":"ComplyAdvantage connection created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid ComplyAdvantage credentials or configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/langfuse":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"public_key":{"type":"string","minLength":1},"secret_key":{"type":"string","minLength":1},"base_url":{"type":"string","format":"uri"},"external_conversation_id_path":{"type":"string"}},"required":["public_key","secret_key","base_url"]}}}},"responses":{"200":{"description":"Langfuse read connection verified and saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]},"project":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"organization_name":{"type":"string","nullable":true}},"required":["id","name","organization_name"]}},"required":["data","project"]}}}},"400":{"description":"Invalid Langfuse credentials or configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/braintrust":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","minLength":1},"api_url":{"type":"string","format":"uri","default":"https://api.braintrust.dev"},"external_conversation_id_path":{"type":"string"}},"required":["api_key"]}}}},"responses":{"200":{"description":"Braintrust read connection verified and saved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"organization_id":{"type":"string","nullable":true}},"required":["id","name","organization_id"]}}},"required":["data","projects"]}}}},"400":{"description":"Invalid Braintrust credentials or configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/{connectionId}/observability-projects":{"get":{"operationId":"listObservabilityProjects","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"connectionId","in":"path"}],"responses":{"200":{"description":"Projects available to assign to an agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["data"]}}}},"400":{"description":"Connection cannot list projects","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/mixmax":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","minLength":1}},"required":["api_key"]}}}},"responses":{"200":{"description":"Mixmax developer token stored","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid Mixmax credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/intercom/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Intercom OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/slack/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Slack OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/linear/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Linear OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/front/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Front OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/zendesk/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subdomain","in":"query"}],"responses":{"200":{"description":"Zendesk OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"400":{"description":"Invalid Zendesk subdomain","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/jira/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Jira OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections":{"get":{"responses":{"200":{"description":"List of connections for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/{connectionId}/integration-assignees":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"connectionId","in":"path"},{"schema":{"type":"string","enum":["admin","team"]},"required":true,"name":"assignee_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Integration employee profiles for the connection, or synced integration groups when assignee_type=team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/linq":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string","minLength":1},"from_numbers":{"type":"array","items":{"type":"string","minLength":1},"minItems":1},"default_from_number":{"type":"string","minLength":1},"label":{"type":"string","minLength":1}},"required":["api_key","from_numbers"]}}}},"responses":{"200":{"description":"Linq connection created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid Linq credentials or configuration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/token/gradient_labs":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"management_api_key":{"type":"string","minLength":1},"integration_api_key":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Gradient Labs connection created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"rulebaseId":{"type":"string","nullable":true},"provider":{"type":"string"},"authType":{"type":"string"},"externalAccountId":{"type":"string","nullable":true},"externalAccountName":{"type":"string","nullable":true},"status":{"type":"string"},"integration":{"type":"object","properties":{"id":{"type":"string"},"uid":{"type":"string"},"name":{"type":"string"}},"required":["id","uid","name"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","rulebaseId","provider","authType","externalAccountId","externalAccountName","status","integration","createdAt","updatedAt"]},"key_checks":{"type":"object","properties":{"management_api_key":{"type":"string","nullable":true,"enum":["valid","wrong_role","invalid","unverified"]},"integration_api_key":{"type":"string","nullable":true,"enum":["valid","wrong_role","invalid","unverified"]}},"required":["management_api_key","integration_api_key"]}},"required":["data","key_checks"]}}}},"400":{"description":"Invalid Gradient Labs credentials","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/{connectionId}":{"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"connectionId","in":"path"}],"responses":{"200":{"description":"Connection disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"400":{"description":"Connection cannot be disconnected here","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/outreach/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Outreach OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/notion/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Notion OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/aircall/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Aircall OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/salesforce/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"Salesforce OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/oauth/github/start":{"get":{"parameters":[{"schema":{"type":"string","format":"uri"},"required":false,"name":"returnTo","in":"query"}],"responses":{"200":{"description":"GitHub OAuth authorization URL","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"authorizationUrl":{"type":"string","format":"uri"}},"required":["authorizationUrl"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"OAuth configuration error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Cursor-paginated conversations. `total` is only computed for the first page and is `null` when the exact count could not complete within its time budget.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"ended_at":{"type":"string","nullable":true,"format":"date-time"},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"reference_id":{"type":"string","nullable":true},"previous_context":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"subject":{"type":"string"},"external_url":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"source_deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"agent_summary":{"type":"string","nullable":true},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_comment":{"type":"string","nullable":true},"last_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"first_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"handling_time":{"type":"string","nullable":true},"time_to_first_response_seconds":{"type":"integer","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"initial_contact_at":{"type":"string","nullable":true,"format":"date-time"},"last_contact_at":{"type":"string","nullable":true,"format":"date-time"},"contacts_count":{"type":"integer","nullable":true},"conversation_customer_sentiment_summary":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"level":{"nullable":true}},"required":["score","level"]},"interaction_type":{"type":"string"},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"review_status":{"type":"string","enum":["unresolved","resolved","compliance_review","none"]},"ticket_status":{"type":"string","enum":["open","resolved"]},"qa_score_ai":{"type":"number","nullable":true},"qa_score_human":{"type":"number","nullable":true},"qa_score_effective":{"type":"number","nullable":true},"qa_score_updated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_auto_fail":{"type":"boolean"},"previous_sentiment_score":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"translated_at":{"type":"string","nullable":true,"format":"date-time"},"language":{"type":"string","nullable":true},"live_summary":{"type":"string","nullable":true},"evaluation_state":{"type":"string"},"transcription_state":{"type":"string"},"translation_state":{"type":"string"},"risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"qa_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"complaint_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"dispute_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"compliance_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"product_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"service_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"churn_risk_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"integer"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","members_count","created_at","updated_at"]},"customer_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["id","name","description"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eligible_for_qa_evaluation":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"employee":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["id","eligible_for_qa_evaluation","created_at","updated_at","employee"]}},"applied_tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"summary":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","normalized_name","summary","created_at","updated_at"]}},"tags":{"type":"array","items":{"type":"string","enum":["complaint","dispute","product_issue","service_issue","compliance_risk","qa"]}},"customer_complaints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","title","summary","categories"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_field":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","conversation_field"]}},"url":{"type":"string","format":"uri"}},"required":["id","started_at","ended_at","summary","external_id","reference_id","previous_context","external_created_at","subject","external_url","jira_issue_key","source_channel","source_deleted_at","created_at","updated_at","agent_summary","closed_at","resolved_at","review_resolved_at","review_comment","last_evaluated_at","first_evaluated_at","qa_evaluated_at","last_synced_at","last_assigned_at","handling_time","time_to_first_response_seconds","channel_types","initial_contact_at","last_contact_at","contacts_count","conversation_customer_sentiment_summary","interaction_type","priority","review_status","ticket_status","qa_score_ai","qa_score_human","qa_score_effective","qa_score_updated_at","qa_auto_fail","previous_sentiment_score","translated_at","language","live_summary","evaluation_state","transcription_state","translation_state","risk_level","qa_risk_level","complaint_risk_level","dispute_risk_level","compliance_risk_level","product_issue_risk_level","service_issue_risk_level","churn_risk_level","requester","data_source","assignee","resolver","assignment_queue","customer_issue","conversation_agents","applied_tags","tags","customer_complaints","clients","field_values","url"]}},"page":{"type":"object","properties":{"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"},"total":{"type":"integer","nullable":true}},"required":["next_cursor","has_more","total"]}},"required":["data","page"]}}}},"400":{"description":"Invalid filter or cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/facets":{"get":{"parameters":[{"schema":{"type":"string","enum":["risk_level","qa_risk_level","complaint_risk_level","product_issue_risk_level","service_issue_risk_level","review_status","priority","ticket_status","assignment_queue_id"]},"required":true,"name":"facet","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Conversation facet counts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}},"required":["value","count"]}},"cache":{"type":"object","properties":{"state":{"type":"string","enum":["hit","stale","miss","redis_error"]}},"required":["state"]}},"required":["data","cache"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/navigation":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Adjacent conversations in the caller's filtered list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previous_id":{"type":"string","nullable":true},"next_id":{"type":"string","nullable":true}},"required":["previous_id","next_id"]}},"required":["data"]}}}},"400":{"description":"Invalid filter or conversation id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization or conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/pinned-conversations":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pinned_conversation":{"type":"object","properties":{"employee_id":{"type":"string"},"conversation_id":{"type":"string"}},"required":["employee_id","conversation_id"]}},"required":["pinned_conversation"]}}}},"responses":{"201":{"description":"Pinned conversation created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"subject":{"type":"string"}},"required":["id","external_id","subject"]},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","avatar_url"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","created_at","updated_at","conversation","employee","created_by"]}},"required":["data"]}}}},"404":{"description":"Employee or conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Conversation already pinned for this employee","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":true,"name":"employee_id","in":"query"}],"responses":{"200":{"description":"List an agent's pinned conversations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"subject":{"type":"string"}},"required":["id","external_id","subject"]},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","avatar_url"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","created_at","updated_at","conversation","employee","created_by"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/pinned-conversations/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Pinned conversation deleted"},"403":{"description":"Pin was created by another member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-part-call-details/{id}/transcribe":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Transcription enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"run_id":{"type":"string"},"job_id":{"type":"string","nullable":true}},"required":["run_id","job_id"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Transcript already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-part-call-detail-transcript-messages/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_part_call_detail_transcript_message":{"type":"object","properties":{"text":{"type":"string"},"text_english":{"type":"string"}}}},"required":["conversation_part_call_detail_transcript_message"]}}}},"responses":{"200":{"description":"Transcript message updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"author_type":{"type":"string"},"start":{"type":"number"},"end":{"type":"number"},"confidence":{"type":"string"},"text":{"type":"string"},"text_english":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","author_type","start","end","confidence","text","text_english","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"At least one of text or text_english is required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-imports":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_import":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"organization_data_source_id":{"type":"string"}},"required":["external_id","organization_data_source_id"]}},"required":["conversation_import"]}}}},"responses":{"200":{"description":"Conversation imported","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Connection or provider record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unsupported data source","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/groups/import":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"child_groups":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"required":["name"]},"minItems":1}},"required":["groups"]}}}},"responses":{"201":{"description":"Groups created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"child_groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","name","child_groups"]}}},"required":["data"]}}}},"403":{"description":"Missing groups:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid group names; nothing was created","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"array","items":{"type":"string"}}},"required":["error","errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/import-historical-conversations-tasks":{"get":{"responses":{"200":{"description":"The organization's historical import tasks, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"num_days":{"type":"integer"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"data_source_key":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","num_days","status","data_source_key","created_at","updated_at"]}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"import_historical_conversations_task":{"type":"object","properties":{"num_days":{"type":"integer","minimum":1,"maximum":3650},"data_source_id":{"type":"string","nullable":true,"enum":["zendesk","intercom","freshdesk"]}},"required":["num_days","data_source_id"]}},"required":["import_historical_conversations_task"]}}}},"responses":{"201":{"description":"Task persisted and enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"num_days":{"type":"integer"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"data_source_key":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","num_days","status","data_source_key","created_at","updated_at"]},"job_id":{"type":"string"}},"required":["data","job_id"]}}}},"404":{"description":"Data source not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/thread":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The conversation's linked-activity thread. `data` is null when the conversation has no thread yet.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedActivityThread"}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{id}/thread":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The work item's linked-activity thread. `data` is null when the work item has no thread yet.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/LinkedActivityThread"}},"required":["data"]}}}},"404":{"description":"Organization or work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_threads":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Page-numbered conversation threads for the organization, each serialized as its root conversation plus thread contact aggregates. Only the Rails `ConversationThreadsController::Filter::KEYS` filters apply.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"ended_at":{"type":"string","nullable":true,"format":"date-time"},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"reference_id":{"type":"string","nullable":true},"previous_context":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"subject":{"type":"string"},"external_url":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"source_deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"agent_summary":{"type":"string","nullable":true},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_comment":{"type":"string","nullable":true},"last_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"first_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"handling_time":{"type":"string","nullable":true},"time_to_first_response_seconds":{"type":"integer","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"initial_contact_at":{"type":"string","nullable":true},"last_contact_at":{"type":"string","nullable":true},"contacts_count":{"type":"integer"},"conversation_customer_sentiment_summary":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"level":{"nullable":true}},"required":["score","level"]},"interaction_type":{"type":"string"},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"review_status":{"type":"string","enum":["unresolved","resolved","compliance_review","none"]},"ticket_status":{"type":"string","enum":["open","resolved"]},"qa_score_ai":{"type":"number","nullable":true},"qa_score_human":{"type":"number","nullable":true},"qa_score_effective":{"type":"number","nullable":true},"qa_score_updated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_auto_fail":{"type":"boolean"},"previous_sentiment_score":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"translated_at":{"type":"string","nullable":true,"format":"date-time"},"language":{"type":"string","nullable":true},"live_summary":{"type":"string","nullable":true},"evaluation_state":{"type":"string"},"transcription_state":{"type":"string"},"translation_state":{"type":"string"},"risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"qa_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"complaint_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"dispute_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"compliance_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"product_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"service_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"churn_risk_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"integer"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","members_count","created_at","updated_at"]},"customer_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["id","name","description"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eligible_for_qa_evaluation":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"employee":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["id","eligible_for_qa_evaluation","created_at","updated_at","employee"]}},"applied_tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"summary":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","normalized_name","summary","created_at","updated_at"]}},"tags":{"type":"array","items":{"type":"string","enum":["complaint","dispute","product_issue","service_issue","compliance_risk","qa"]}},"customer_complaints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","title","summary","categories"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_field":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","conversation_field"]}},"url":{"type":"string","format":"uri"}},"required":["id","started_at","ended_at","summary","external_id","reference_id","previous_context","external_created_at","subject","external_url","jira_issue_key","source_channel","source_deleted_at","created_at","updated_at","agent_summary","closed_at","resolved_at","review_resolved_at","review_comment","last_evaluated_at","first_evaluated_at","qa_evaluated_at","last_synced_at","last_assigned_at","handling_time","time_to_first_response_seconds","channel_types","initial_contact_at","last_contact_at","contacts_count","conversation_customer_sentiment_summary","interaction_type","priority","review_status","ticket_status","qa_score_ai","qa_score_human","qa_score_effective","qa_score_updated_at","qa_auto_fail","previous_sentiment_score","translated_at","language","live_summary","evaluation_state","transcription_state","translation_state","risk_level","qa_risk_level","complaint_risk_level","dispute_risk_level","compliance_risk_level","product_issue_risk_level","service_issue_risk_level","churn_risk_level","requester","data_source","assignee","resolver","assignment_queue","customer_issue","conversation_agents","applied_tags","tags","customer_complaints","clients","field_values","url"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"integer","nullable":true},"previous":{"type":"integer","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","previous","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/qa_evaluations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"responses":{"200":{"description":"Every `qa_evaluations` record (manual, AI and CX-risk sourced) for a conversation visible to the caller, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overall_score":{"type":"number","nullable":true},"conversation_id":{"type":"string"},"evaluator_membership_id":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","source","created_at","updated_at","overall_score","conversation_id","evaluator_membership_id","evaluation_assignment_id","conversation_cx_risk_snapshot_id","files"]}}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/conversation_cx_risk_snapshot_scorecard_results":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"responses":{"200":{"description":"Scorecard results of the conversation's active CX-risk evaluation, newest first; empty when there is no active evaluation.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"applicable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"conversation_cx_risk_snapshot_scorecard_criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string","enum":["binary","scaled","options"]},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"scorecard_criterion_weight":{"type":"number"},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"evaluation_guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string","enum":["binary","scaled","options"]},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"scorecard_criterion_weight":{"type":"number"},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"evaluation_guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string","enum":["binary","scaled","options"]},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"scorecard_criterion_weight":{"type":"number"},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"evaluation_guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}}},"required":["id","reason","created_at","updated_at","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","scorecard_criterion_weight","selected_score_option","selected_justification_option","evaluation_guiding_question_answers","comments"]}}},"required":["id","reason","created_at","updated_at","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","scorecard_criterion_weight","selected_score_option","selected_justification_option","evaluation_guiding_question_answers","comments","children"]}}},"required":["id","reason","created_at","updated_at","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","scorecard_criterion_weight","selected_score_option","selected_justification_option","evaluation_guiding_question_answers","comments","children"]}}},"required":["id","applicable","created_at","updated_at","score","max_score","scorecard","conversation_cx_risk_snapshot_scorecard_criterion_results"]}}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_cx_risk_snapshots/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A CX-risk snapshot in the caller's organization.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"risk_level":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"suggestion":{"type":"string","nullable":true},"negative_sentiment_summary":{"type":"string","nullable":true},"agent_knowledge_gap_summary":{"type":"string","nullable":true},"customer_issue_summary":{"type":"string","nullable":true},"active":{"type":"boolean"},"individual_agents_evaluated":{"type":"boolean"},"customer_churn_risk_level":{"type":"string","enum":["none","low","medium","high"]},"trigger_type":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"negative_sentiment_score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","risk_level","summary","description","suggestion","negative_sentiment_summary","agent_knowledge_gap_summary","customer_issue_summary","active","individual_agents_evaluated","customer_churn_risk_level","trigger_type","qa_score","negative_sentiment_score","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Missing `conversation_cx_risk_snapshot:all`","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Snapshot not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/search":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"external_id","in":"query"}],"responses":{"200":{"description":"Read-only provider lookup for a ticket id that is not yet imported. Never persists, enqueues or imports anything.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"suggested_conversation_import":{"type":"object","nullable":true,"properties":{"subject":{"type":"string","nullable":true},"external_id":{"type":"string"},"organization_data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["subject","external_id","organization_data_source"]}},"required":["suggested_conversation_import"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_assignments":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Organization-scoped conversation assignments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"resolution_comment":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"created_by_type":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","members_count","distribution_mode","created_at","updated_at"]},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]},"transferred_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]}},"required":["id","status","created_at","resolved_at","resolution_comment","ended_at","created_by_type","conversation_id","conversation_external_id","assignee","resolver","assignment_queue","created_by_membership","transferred_by_membership"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_assignments/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A conversation assignment","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"resolution_comment":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"created_by_type":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","members_count","distribution_mode","created_at","updated_at"]},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]},"transferred_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","account"]}},"required":["id","status","created_at","resolved_at","resolution_comment","ended_at","created_by_type","conversation_id","conversation_external_id","assignee","resolver","assignment_queue","created_by_membership","transferred_by_membership"]}},"required":["data"]}}}},"404":{"description":"Assignment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/qa_evaluation_requests":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"QA evaluation requests for a conversation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"trigger_type":{"type":"string"},"skip_reason":{"type":"string","nullable":true},"skip_reason_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"prep_completed_at":{"type":"string","nullable":true},"evaluation_started_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"scheduled_for":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation_id":{"type":"string"},"requested_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true}},"required":["id","status","trigger_type","skip_reason","skip_reason_message","error_message","prep_completed_at","evaluation_started_at","completed_at","scheduled_for","created_at","updated_at","conversation_id","requested_by_id","qa_evaluation_id"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"trigger_type":{"type":"string","enum":["user_requested"]}}}}}},"responses":{"201":{"description":"User-requested QA evaluation request created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"trigger_type":{"type":"string"},"skip_reason":{"type":"string","nullable":true},"skip_reason_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"prep_completed_at":{"type":"string","nullable":true},"evaluation_started_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"scheduled_for":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation_id":{"type":"string"},"requested_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true}},"required":["id","status","trigger_type","skip_reason","skip_reason_message","error_message","prep_completed_at","evaluation_started_at","completed_at","scheduled_for","created_at","updated_at","conversation_id","requested_by_id","qa_evaluation_id"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Conversation already has an active evaluation request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/compliance_criterion_group_results":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance criterion group results of the conversation's active evaluation. Empty when the conversation has no active evaluation.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"compliance_criterion_group":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"evaluation_compliance_criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string","enum":["passed","failed","not_applicable"]},"summary":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"compliance_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","compliance_criterion_group_id"]},"evaluation_compliance_criterion_result_references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_part_id":{"type":"string"},"conversation_part_call_detail_transcript_message_id":{"type":"string","nullable":true}},"required":["id","conversation_part_id","conversation_part_call_detail_transcript_message_id"]}}},"required":["id","result","summary","created_at","updated_at","compliance_criterion","evaluation_compliance_criterion_result_references"]}}},"required":["id","created_at","updated_at","compliance_criterion_group","evaluation_compliance_criterion_results"]}}},"required":["data"]}}}},"400":{"description":"Invalid conversation id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_cx_risk_snapshot_completions/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_cx_risk_snapshot_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"completion_key":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["conversation_cx_risk_snapshot_id","organization_id","completion_key"]}}}},"responses":{"202":{"description":"Conversation CX-risk completion enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_cx_risk_starts/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"trigger_type":{"type":"string","enum":["ticket_closed","user_requested","admin_forced"]}},"required":["conversation_id","organization_id","trigger_type"]}}}},"responses":{"202":{"description":"Conversation CX-risk start enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/evaluation_check_runs/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_check_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_key":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["evaluation_check_id","organization_id","run_key"]}}}},"responses":{"202":{"description":"Evaluation check run enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Conversation detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"ended_at":{"type":"string","nullable":true,"format":"date-time"},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"reference_id":{"type":"string","nullable":true},"previous_context":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"subject":{"type":"string"},"external_url":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"source_deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"agent_summary":{"type":"string","nullable":true},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_comment":{"type":"string","nullable":true},"last_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"first_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"handling_time":{"type":"string","nullable":true},"time_to_first_response_seconds":{"type":"integer","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"initial_contact_at":{"type":"string","nullable":true,"format":"date-time"},"last_contact_at":{"type":"string","nullable":true,"format":"date-time"},"contacts_count":{"type":"integer","nullable":true},"conversation_customer_sentiment_summary":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"level":{"nullable":true}},"required":["score","level"]},"interaction_type":{"type":"string"},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"review_status":{"type":"string","enum":["unresolved","resolved","compliance_review","none"]},"ticket_status":{"type":"string","enum":["open","resolved"]},"qa_score_ai":{"type":"number","nullable":true},"qa_score_human":{"type":"number","nullable":true},"qa_score_effective":{"type":"number","nullable":true},"qa_score_updated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_auto_fail":{"type":"boolean"},"previous_sentiment_score":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"translated_at":{"type":"string","nullable":true,"format":"date-time"},"language":{"type":"string","nullable":true},"live_summary":{"type":"string","nullable":true},"evaluation_state":{"type":"string"},"transcription_state":{"type":"string"},"translation_state":{"type":"string"},"risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"qa_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"complaint_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"dispute_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"compliance_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"product_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"service_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"churn_risk_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"integer"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","members_count","created_at","updated_at"]},"customer_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["id","name","description"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eligible_for_qa_evaluation":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"employee":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["id","eligible_for_qa_evaluation","created_at","updated_at","employee"]}},"applied_tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"summary":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","normalized_name","summary","created_at","updated_at"]}},"tags":{"type":"array","items":{"type":"string","enum":["complaint","dispute","product_issue","service_issue","compliance_risk","qa"]}},"customer_complaints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","title","summary","categories"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_field":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","conversation_field"]}},"url":{"type":"string","format":"uri"},"description":{"type":"string","nullable":true},"qa_risk_summary":{"type":"string","nullable":true},"individual_agents_evaluated":{"type":"boolean"},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","created_at","updated_at"]},"zendesk_brand":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"tracking_status":{"type":"string","nullable":true},"help_center_locales":{"type":"array","items":{"type":"string"}},"avatar_url":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","subdomain","external_id","tracking_status","help_center_locales","avatar_url","created_at","updated_at"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","full_name","employees_count","parent_group_id","parent_group_name","created_at","updated_at"]},"partners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"dispute":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"summary":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"amount":{"type":"number","nullable":true},"currency_code":{"type":"string","nullable":true},"filed_at":{"type":"string","nullable":true},"resolution_due_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"resolution_summary":{"type":"string","nullable":true},"acknowledged_at":{"type":"string","nullable":true},"acknowledgement_due_at":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","summary","status","amount","currency_code","filed_at","resolution_due_at","resolved_at","resolution_summary","acknowledged_at","acknowledgement_due_at","jira_issue_key","conversation_id","created_at","updated_at"]},"manual_evaluation":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"overall_score":{"type":"number"},"max_score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"scorecard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"}},"required":["id","name","description","nested_criteria","two_level"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","scorecard","criterion_results"]}}},"required":["id","overall_score","max_score","created_at","updated_at","evaluator","scorecard_results"]},"sla_breaches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}},"conversation_part_sla_breaches":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}}}},"required":["id","started_at","ended_at","summary","external_id","reference_id","previous_context","external_created_at","subject","external_url","jira_issue_key","source_channel","source_deleted_at","created_at","updated_at","agent_summary","closed_at","resolved_at","review_resolved_at","review_comment","last_evaluated_at","first_evaluated_at","qa_evaluated_at","last_synced_at","last_assigned_at","handling_time","time_to_first_response_seconds","channel_types","initial_contact_at","last_contact_at","contacts_count","conversation_customer_sentiment_summary","interaction_type","priority","review_status","ticket_status","qa_score_ai","qa_score_human","qa_score_effective","qa_score_updated_at","qa_auto_fail","previous_sentiment_score","translated_at","language","live_summary","evaluation_state","transcription_state","translation_state","risk_level","qa_risk_level","complaint_risk_level","dispute_risk_level","compliance_risk_level","product_issue_risk_level","service_issue_risk_level","churn_risk_level","requester","data_source","assignee","resolver","assignment_queue","customer_issue","conversation_agents","applied_tags","tags","customer_complaints","clients","field_values","url","description","qa_risk_summary","individual_agents_evaluated","company","zendesk_brand","group","partners","dispute","manual_evaluation","sla_breaches","conversation_part_sla_breaches"]}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"summary":"Update a conversation's review status or assignee","tags":["Conversations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"conversation":{"type":"object","properties":{"review_status":{"type":"string"},"assignee_id":{"type":"string","nullable":true},"assignee_account_ids":{"type":"array","items":{"type":"string"}},"assignee_role_ids":{"type":"array","items":{"type":"string"}}}}},"required":["conversation"]}}}},"responses":{"200":{"description":"Conversation updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"ended_at":{"type":"string","nullable":true,"format":"date-time"},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"reference_id":{"type":"string","nullable":true},"previous_context":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"subject":{"type":"string"},"external_url":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"source_deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"agent_summary":{"type":"string","nullable":true},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_comment":{"type":"string","nullable":true},"last_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"first_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"handling_time":{"type":"string","nullable":true},"time_to_first_response_seconds":{"type":"integer","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"initial_contact_at":{"type":"string","nullable":true,"format":"date-time"},"last_contact_at":{"type":"string","nullable":true,"format":"date-time"},"contacts_count":{"type":"integer","nullable":true},"conversation_customer_sentiment_summary":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"level":{"nullable":true}},"required":["score","level"]},"interaction_type":{"type":"string"},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"review_status":{"type":"string","enum":["unresolved","resolved","compliance_review","none"]},"ticket_status":{"type":"string","enum":["open","resolved"]},"qa_score_ai":{"type":"number","nullable":true},"qa_score_human":{"type":"number","nullable":true},"qa_score_effective":{"type":"number","nullable":true},"qa_score_updated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_auto_fail":{"type":"boolean"},"previous_sentiment_score":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"translated_at":{"type":"string","nullable":true,"format":"date-time"},"language":{"type":"string","nullable":true},"live_summary":{"type":"string","nullable":true},"evaluation_state":{"type":"string"},"transcription_state":{"type":"string"},"translation_state":{"type":"string"},"risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"qa_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"complaint_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"dispute_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"compliance_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"product_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"service_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"churn_risk_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"integer"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","members_count","created_at","updated_at"]},"customer_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["id","name","description"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eligible_for_qa_evaluation":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"employee":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["id","eligible_for_qa_evaluation","created_at","updated_at","employee"]}},"applied_tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"summary":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","normalized_name","summary","created_at","updated_at"]}},"tags":{"type":"array","items":{"type":"string","enum":["complaint","dispute","product_issue","service_issue","compliance_risk","qa"]}},"customer_complaints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","title","summary","categories"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_field":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","conversation_field"]}},"url":{"type":"string","format":"uri"},"description":{"type":"string","nullable":true},"qa_risk_summary":{"type":"string","nullable":true},"individual_agents_evaluated":{"type":"boolean"},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","created_at","updated_at"]},"zendesk_brand":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"tracking_status":{"type":"string","nullable":true},"help_center_locales":{"type":"array","items":{"type":"string"}},"avatar_url":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","subdomain","external_id","tracking_status","help_center_locales","avatar_url","created_at","updated_at"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","full_name","employees_count","parent_group_id","parent_group_name","created_at","updated_at"]},"partners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"dispute":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"summary":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"amount":{"type":"number","nullable":true},"currency_code":{"type":"string","nullable":true},"filed_at":{"type":"string","nullable":true},"resolution_due_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"resolution_summary":{"type":"string","nullable":true},"acknowledged_at":{"type":"string","nullable":true},"acknowledgement_due_at":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","summary","status","amount","currency_code","filed_at","resolution_due_at","resolved_at","resolution_summary","acknowledged_at","acknowledgement_due_at","jira_issue_key","conversation_id","created_at","updated_at"]},"manual_evaluation":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"overall_score":{"type":"number"},"max_score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"scorecard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"}},"required":["id","name","description","nested_criteria","two_level"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","scorecard","criterion_results"]}}},"required":["id","overall_score","max_score","created_at","updated_at","evaluator","scorecard_results"]},"sla_breaches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}},"conversation_part_sla_breaches":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}}}},"required":["id","started_at","ended_at","summary","external_id","reference_id","previous_context","external_created_at","subject","external_url","jira_issue_key","source_channel","source_deleted_at","created_at","updated_at","agent_summary","closed_at","resolved_at","review_resolved_at","review_comment","last_evaluated_at","first_evaluated_at","qa_evaluated_at","last_synced_at","last_assigned_at","handling_time","time_to_first_response_seconds","channel_types","initial_contact_at","last_contact_at","contacts_count","conversation_customer_sentiment_summary","interaction_type","priority","review_status","ticket_status","qa_score_ai","qa_score_human","qa_score_effective","qa_score_updated_at","qa_auto_fail","previous_sentiment_score","translated_at","language","live_summary","evaluation_state","transcription_state","translation_state","risk_level","qa_risk_level","complaint_risk_level","dispute_risk_level","compliance_risk_level","product_issue_risk_level","service_issue_risk_level","churn_risk_level","requester","data_source","assignee","resolver","assignment_queue","customer_issue","conversation_agents","applied_tags","tags","customer_complaints","clients","field_values","url","description","qa_risk_summary","individual_agents_evaluated","company","zendesk_brand","group","partners","dispute","manual_evaluation","sla_breaches","conversation_part_sla_breaches"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not be saved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_part_attachments/{id}":{"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Attachment removed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"removed":{"type":"boolean","enum":[true]},"removed_at":{"type":"string","format":"date-time"},"file_url":{"nullable":true}},"required":["id","removed","removed_at","file_url"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Attachment not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Stored file purge failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/conversation_parts":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"conversation_id","in":"path"}],"responses":{"200":{"description":"Conversation parts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationPart"}}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/trace":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Factual TRACE for a conversation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"conversationId":{"type":"string","minLength":1},"railsConversationId":{"type":"integer"},"stepCount":{"type":"integer","minimum":0},"gapCount":{"type":"integer","minimum":0},"brokenCount":{"type":"integer","minimum":0},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["customer_message","bot_message","agent_message","action","handoff","gap","broken"]},"label":{"type":"string","minLength":1,"maxLength":40},"content":{"type":"string","minLength":1,"maxLength":1200},"at":{"type":"string","nullable":true},"durationMs":{"type":"integer","nullable":true,"minimum":0}},"required":["kind","label","content","at","durationMs"]},"maxItems":60}},"required":["conversationId","railsConversationId","stepCount","gapCount","brokenCount","steps"]}},"required":["data"]}}}},"404":{"description":"Conversation or TRACE not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/evaluation_contests":{"get":{"summary":"List evaluation contests raised against a conversation","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"string","description":"JSON-encoded evaluation contest filters"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Evaluation contests for the conversation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"contested_evaluation_score":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_review_status":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"work_item_review_status":{"type":"string","nullable":true},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","avatar_url"]},"scorecard_criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contest_score":{"type":"boolean","nullable":true},"contest_feedback":{"type":"boolean","nullable":true},"comment":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluation_scorecard_criterion_result":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at"]}}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at","children"]}}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at","children"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","contest_score","contest_feedback","comment","files","qa_agent_evaluation_scorecard_criterion_result","created_at","updated_at"]}},"feedback":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"submitted_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"evaluation_contest_criterion_feedbacks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contest_accepted":{"type":"boolean"},"notes":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"qa_agent_evaluation_scorecard_criterion_result":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","contest_accepted","notes","score","files","selected_score_option","qa_agent_evaluation_scorecard_criterion_result","created_at","updated_at"]}}},"required":["id","submitted_at","created_at","updated_at","submitted_by","evaluation_contest_criterion_feedbacks"]}},"required":["id","status","outcome","display_outcome","contest_level","contested_evaluation_score","created_at","updated_at","conversation_id","conversation_external_id","conversation_summary","conversation_review_status","work_item_id","work_item_external_id","work_item_summary","work_item_review_status","conversation_assignee","employee","scorecard_criterion_results","feedback"]}}},"required":["data"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Contest a conversation evaluation","description":"Creates an evaluation contest against a QA agent evaluation or CX-risk snapshot on the conversation. Routing, QA assignment and reviewer notification run asynchronously after the contest commits.","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_contest":{"type":"object","properties":{"qa_agent_evaluation_id":{"type":"string"},"conversation_cx_risk_snapshot_id":{"type":"string"},"scorecard_criterion_results":{"type":"array","items":{"type":"object","properties":{"qa_agent_evaluation_scorecard_criterion_result_id":{"type":"string"},"conversation_cx_risk_snapshot_scorecard_criterion_result_id":{"type":"string"},"contest_score":{"type":"boolean"},"contest_feedback":{"type":"boolean"},"comment":{"type":"string"},"file_signed_ids":{"type":"array","items":{"type":"string"}}},"required":["contest_score","contest_feedback","comment"]}}},"required":["scorecard_criterion_results"]}},"required":["evaluation_contest"]}}}},"responses":{"201":{"description":"Evaluation contest created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_translations/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_slug":{"type":"string","minLength":1}},"required":["conversation_id","organization_slug"]}}}},"responses":{"202":{"description":"Conversation translation job enqueued or skipped","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true},"skipped":{"type":"boolean"},"skipReason":{"type":"string","nullable":true}},"required":["jobId","skipped","skipReason"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/translate":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Conversation translation requested. `skipped` is true when the conversation needs no translation work.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true},"skipped":{"type":"boolean"},"skipReason":{"type":"string","nullable":true},"id":{"type":"string"},"translation_state":{"type":"string"}},"required":["jobId","skipped","skipReason","id","translation_state"]}},"required":["data"]}}}},"400":{"description":"Invalid conversation id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization or conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_summaries/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_slug":{"type":"string","minLength":1},"delivery_key":{"type":"string","minLength":1}},"required":["conversation_id","organization_slug"]}}}},"responses":{"202":{"description":"Conversation summary job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_transcriptions/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string","minLength":1},"organization_slug":{"type":"string","minLength":1},"run_id":{"type":"string","minLength":1},"call_detail_ids":{"type":"array","items":{"type":"string","minLength":1}},"image_caption_parts":{"type":"array","items":{"type":"object","properties":{"conversation_part_id":{"type":"string","minLength":1},"run_id":{"type":"string","minLength":1}},"required":["conversation_part_id","run_id"]},"default":[]},"user_requested":{"type":"boolean","default":false}},"required":["conversation_id","organization_slug","run_id","call_detail_ids"]}}}},"responses":{"202":{"description":"Conversation transcription jobs enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true},"callJobCount":{"type":"integer","minimum":0},"imageCaptionJobCount":{"type":"integer","minimum":0}},"required":["jobId","callJobCount","imageCaptionJobCount"]}},"required":["data"]}}}},"400":{"description":"No calls to transcribe","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_transcriptions/calls/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string","minLength":1},"organization_slug":{"type":"string","minLength":1},"run_id":{"type":"string","minLength":1},"call_detail_id":{"type":"string","minLength":1}},"required":["conversation_id","organization_slug","run_id","call_detail_id"]}}}},"responses":{"202":{"description":"Call transcription job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_part_image_captions/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"string","minLength":1},"conversation_part_id":{"type":"string","minLength":1},"organization_slug":{"type":"string","minLength":1},"run_id":{"type":"string","minLength":1}},"required":["conversation_id","conversation_part_id","organization_slug","run_id"]}}}},"responses":{"202":{"description":"Conversation part image caption job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_relationships/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"change_key":{"type":"string","minLength":1,"maxLength":200}},"required":["conversation_id","organization_id","change_key"]}}}},"responses":{"202":{"description":"Conversation relationship link job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string","nullable":true}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_part_relationships/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_part_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_part_id","organization_id"]}}}},"responses":{"202":{"description":"Conversation part relationship link jobs enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobIds":{"type":"array","items":{"type":"string","nullable":true}}},"required":["jobIds"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_redactions/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_id","organization_id"]}}}},"responses":{"202":{"description":"Conversation redaction jobs scheduled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobIds":{"type":"array","items":{"type":"string"}}},"required":["jobIds"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_topic_embeddings/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_id","organization_id"]}}}},"responses":{"202":{"description":"Conversation topic embedding job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"delayedMs":{"type":"integer","minimum":0}},"required":["jobId","delayedMs"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_topic_embeddings/patch_tagging":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_id","organization_id"]}}}},"responses":{"200":{"description":"Patched customer_issue_id / is_untagged without re-embedding","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"conversationId":{"type":"integer"},"customerIssueId":{"type":"integer","nullable":true},"isUntagged":{"type":"boolean"}},"required":["conversationId","customerIssueId","isUntagged"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_topic_embeddings/search":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"topic_text":{"type":"string","minLength":1},"top_k":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200,"default":20},"min_similarity":{"type":"number","minimum":0,"maximum":1,"default":0.7},"untagged_only":{"type":"boolean","default":true}},"required":["organization_id","topic_text"]}}}},"responses":{"200":{"description":"Nearest conversations for a topic","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"integer"},"conversation_prefix_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"customer_issue_id":{"type":"integer","nullable":true},"is_untagged":{"type":"boolean"},"organization_data_source_id":{"type":"integer","nullable":true},"ticket_status":{"type":"integer","nullable":true},"distance":{"type":"number"},"similarity":{"type":"number"}},"required":["conversation_id","conversation_prefix_id","conversation_external_id","customer_issue_id","is_untagged","organization_data_source_id","ticket_status","distance","similarity"]}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/bot_handoff_summaries/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"delay_ms":{"type":"integer","nullable":true,"minimum":0},"force":{"type":"boolean"}},"required":["conversation_id","organization_id"]}}}},"responses":{"202":{"description":"Bot handoff summary generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"delayedMs":{"type":"integer","minimum":0}},"required":["jobId","delayedMs"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/bot_handoff_gap_topics/recluster":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"bot_id":{"type":"string","format":"uuid"}},"required":["organization_id"]}}}},"responses":{"202":{"description":"Bot handoff gap topic recluster enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/organization_memory/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"source_type":{"type":"string","enum":["evaluation","comment","document"]},"source_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"actor_account_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"deleted":{"type":"boolean","default":false}},"required":["organization_id","source_type","source_id","actor_account_id"]}}}},"responses":{"202":{"description":"Memory learning queued","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents/{documentId}/memory-history":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"Memory revisions and supporting reviewer feedback","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"title":{"type":"string"},"content":{"type":"string"},"created_at":{"type":"string"},"reason":{"type":"string","nullable":true},"sources":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","nullable":true},"source_type":{"type":"string"},"source_id":{"type":"number"},"occurred_at":{"type":"string"},"withdrawn":{"type":"boolean"}},"required":["id","url","source_type","source_id","occurred_at","withdrawn"]}}},"required":["id","action","title","content","created_at","reason","sources"]}}},"required":["data"]}}}},"404":{"description":"Document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_topic_customer_issue_assignments/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_id","organization_id"]}}}},"responses":{"202":{"description":"Customer issue assignment job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"conversationId":{"type":"integer"}},"required":["jobId","conversationId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/customer_issue_embeddings/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_issue_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["customer_issue_id","organization_id"]}}}},"responses":{"202":{"description":"Customer issue Voyage topic embedding upserted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"customerIssueId":{"type":"integer"},"status":{"type":"string","enum":["indexed","skipped"]},"reason":{"type":"string"}},"required":["customerIssueId","status"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Customer issue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/customer_issue_embeddings/match":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"topic_text":{"type":"string","minLength":1},"top_k":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":50,"default":5},"min_similarity":{"type":"number","minimum":0,"maximum":1,"default":0.6}},"required":["organization_id","topic_text"]}}}},"responses":{"200":{"description":"Best Voyage CustomerIssue match above similarity floor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"customer_issue_id":{"type":"integer"},"similarity":{"type":"number"},"distance":{"type":"number"}},"required":["customer_issue_id","similarity","distance"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/customer_issue_embeddings/delete":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"customer_issue_ids":{"type":"array","items":{"type":"integer","minimum":0,"exclusiveMinimum":true},"minItems":1,"maxItems":500}},"required":["organization_id","customer_issue_ids"]}}}},"responses":{"200":{"description":"Customer issue Voyage topic documents deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted_count":{"type":"integer"}},"required":["deleted_count"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Turbopuffer not configured","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/sync":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Conversation re-sync requested. `skipped` is true when the conversation has no syncable provider source.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"jobId":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true,"enum":["intercom","zendesk","freshdesk","jira","outreach","xcally"]},"skipped":{"type":"boolean"},"skipReason":{"type":"string","nullable":true}},"required":["id","jobId","provider","skipped","skipReason"]}},"required":["data"]}}}},"400":{"description":"Invalid conversation id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/provider_conversation_syncs/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"provider":{"type":"string","enum":["intercom","zendesk","freshdesk","jira","outreach","xcally"]},"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_data_source_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"delay_ms":{"type":"integer","nullable":true,"minimum":0}},"required":["provider","conversation_id","organization_id","organization_data_source_id"]}}}},"responses":{"202":{"description":"Provider conversation sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Sync target not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/provider_conversation_sync_completions/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sync_run_id":{"type":"string","pattern":"^[a-zA-Z0-9_-]{1,200}$"}},"required":["conversation_id","organization_id","sync_run_id"]}}}},"responses":{"202":{"description":"Provider conversation sync completion enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Completion target not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/zendesk_webhook_ticket_syncs/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"run_id":{"type":"string","minLength":1},"zendesk_webhook_ticket_sync_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["run_id","zendesk_webhook_ticket_sync_id","organization_id"]}}}},"responses":{"202":{"description":"Zendesk webhook ticket sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"deduplicationId":{"type":"string"}},"required":["jobId","deduplicationId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/conversation_uploads/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_upload_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_upload_id","organization_id"]}}}},"responses":{"202":{"description":"Conversation upload processing enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/daily_agent_evaluation_reports/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_slug":{"type":"string","minLength":1},"organization_name":{"type":"string"},"date":{"type":"string","minLength":1},"send_email":{"type":"boolean"},"queue_backfill":{"type":"boolean"},"source":{"type":"string","enum":["admin","backfill"]}},"required":["organization_id","organization_slug","date"]}}}},"responses":{"202":{"description":"Organization report enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_evaluation_backfills/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["preview"]},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["kind","organization_id","run_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["confirm"]},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["kind","organization_id","run_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["replacement"]},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_agent_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"replaces_qa_evaluation_request_id":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["kind","organization_id","run_agent_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["backdate"]},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"run_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["kind","organization_id","run_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["reconcile"]},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"wait_attempt":{"type":"integer","nullable":true,"minimum":0}},"required":["kind","organization_id","target_date"]}]}}}},"responses":{"202":{"description":"QA evaluation backfill job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_criterion_result_chunk_syncs/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"criterion_result_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["organization_id","criterion_result_id"]}}}},"responses":{"202":{"description":"Chunk sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_feedback_generation/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"kind":{"type":"string","enum":["expanded_comment","criterion_feedback"]},"force":{"type":"boolean","default":false}},"required":["organization_id","evaluation_id","kind"]}}}},"responses":{"202":{"description":"Feedback generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_stale_dependent_re_adjudication/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["organization_id","evaluation_id"]}}}},"responses":{"202":{"description":"Stale dependent re-adjudication enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/rulebase_webhook_events/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"eventId":{"type":"string","minLength":1,"maxLength":200},"event":{"oneOf":[{"type":"object","properties":{"eventType":{"type":"string","enum":["ticket_created"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"transcript":{"type":"string"},"interactionType":{"type":"string"},"externalId":{"type":"string"},"connection":{"type":"object","properties":{"rulebaseId":{"type":"string"},"integration":{"type":"object","properties":{"uid":{"type":"string"},"name":{"type":"string"}},"required":["uid","name"]}},"required":["rulebaseId","integration"]}},"required":["id","prefixId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["ticket_updated"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"transcript":{"type":"string"},"interactionType":{"type":"string"},"externalId":{"type":"string"},"connection":{"type":"object","properties":{"rulebaseId":{"type":"string"},"integration":{"type":"object","properties":{"uid":{"type":"string"},"name":{"type":"string"}},"required":["uid","name"]}},"required":["rulebaseId","integration"]}},"required":["id","prefixId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["conversation_assigned"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"assigneeMembershipId":{"type":"string"}},"required":["id","prefixId","assigneeMembershipId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["conversation_synced"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"prefixId":{"type":"string"}},"required":["id","prefixId"]},"features":{"type":"object","properties":{"topicEmbeddingEnabled":{"type":"boolean"},"salesCallCompliancePipelineEnabled":{"type":"boolean"}},"required":["topicEmbeddingEnabled"]}},"required":["eventType","organizationId","conversation","features"]}]}},"required":["eventId","event"]}}}},"responses":{"202":{"description":"Webhook event enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/counter_caches/enqueue":{"post":{"responses":{"202":{"description":"Counter cache fix enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/weekly_insights/knowledge_gap_reports/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"week_start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"week_end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["organization_id","week_start_date","week_end_date"]}}}},"responses":{"202":{"description":"Knowledge-gap report generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/weekly_insights/customer_issues/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["organization_id"]}}}},"responses":{"202":{"description":"Customer-issue generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/knowledge_base_sync/enqueue":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"requests":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["source"]},"source_id":{"type":"integer"},"organization_id":{"type":"integer"}},"required":["kind","source_id","organization_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["document"]},"document_id":{"type":"integer"},"organization_id":{"type":"integer"}},"required":["kind","document_id","organization_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["document_chunks"]},"document_id":{"type":"integer"},"organization_id":{"type":"integer"}},"required":["kind","document_id","organization_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["crawl_start"]},"crawl_task_id":{"type":"integer"},"organization_id":{"type":"integer"}},"required":["kind","crawl_task_id","organization_id"]},{"type":"object","properties":{"kind":{"type":"string","enum":["crawl_url"]},"crawl_task_id":{"type":"integer"},"organization_id":{"type":"integer"},"url":{"type":"string"},"depth":{"type":"integer"}},"required":["kind","crawl_task_id","organization_id","url","depth"]},{"type":"object","properties":{"kind":{"type":"string","enum":["crawl_batch"]},"crawl_task_id":{"type":"integer"},"organization_id":{"type":"integer"},"urls":{"type":"array","items":{"type":"string","format":"uri"},"minItems":1,"maxItems":20}},"required":["kind","crawl_task_id","organization_id","urls"]}]},"maxItems":1000}},"required":["requests"]}}}},"responses":{"202":{"description":"Knowledge base sync work durably enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enqueued":{"type":"number"},"jobIds":{"type":"array","items":{"type":"string"}}},"required":["enqueued","jobIds"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/agent_performance_reports/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_slug":{"type":"string","minLength":1},"organization_name":{"type":"string"},"start_date":{"type":"string","minLength":1},"end_date":{"type":"string","minLength":1},"report_type":{"type":"string","minLength":1}},"required":["organization_id","start_date","end_date"]}}}},"responses":{"202":{"description":"Organization report generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/agent_performance_reports/enqueue_content":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"report_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"report_type":{"type":"string","minLength":1}},"required":["organization_id","report_id"]}}}},"responses":{"202":{"description":"Report content generation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/agent_performance_reports/enqueue_preview":{"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"202":{"description":"Preview tick enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/agent_performance_reports/enqueue_send":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_slug":{"type":"string","minLength":1},"organization_name":{"type":"string"},"start_date":{"type":"string","minLength":1},"end_date":{"type":"string","minLength":1},"report_type":{"type":"string","minLength":1},"auto_scheduled":{"type":"boolean"}},"required":["organization_id","start_date","end_date"]}}}},"responses":{"202":{"description":"Organization email send enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/intercom_conversation_imports/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_data_source_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"intercom_conversation_id":{"type":"string","minLength":1}},"required":["organization_id","organization_data_source_id","intercom_conversation_id"]}}}},"responses":{"202":{"description":"Intercom conversation import enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/intercom_ticket_imports/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_data_source_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"intercom_ticket_id":{"type":"string","minLength":1}},"required":["organization_id","organization_data_source_id","intercom_ticket_id"]}}}},"responses":{"202":{"description":"Intercom ticket import enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/slack/proactive-assistant-turns":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"recipient_membership_id":{"type":"string","minLength":1},"prompt":{"type":"string","minLength":1,"maxLength":10000},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["evaluation_contest"]},"id":{"type":"string","minLength":1}},"required":["type","id"]},"delivery_key":{"type":"string","minLength":1,"maxLength":500}},"required":["organization_id","recipient_membership_id","delivery_key"]}}}},"responses":{"202":{"description":"Proactive Slack assistant turn accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"delivery_key":{"type":"string"},"job_id":{"type":"string","nullable":true}},"required":["delivery_key","job_id"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_evaluation_requests/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation_request_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"delay_ms":{"type":"integer","nullable":true,"minimum":0}},"required":["qa_evaluation_request_id","organization_id","conversation_id"]}}}},"responses":{"202":{"description":"QA evaluation request orchestration enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_evaluation_billing/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_agent_evaluation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["qa_agent_evaluation_id","organization_id"]}}}},"responses":{"202":{"description":"QA evaluation billing enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/complaint-slack-follow-ups/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"channel_id":{"type":"string","minLength":1},"thread_ts":{"type":"string","minLength":1},"api2_slack_channel_id":{"type":"string","nullable":true},"delivery_key":{"type":"string","minLength":1},"generator":{"type":"object","additionalProperties":{"nullable":true}}},"required":["organization_id","channel_id","thread_ts","delivery_key","generator"]}}}},"responses":{"202":{"description":"Complaint Slack follow-up enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/complaint-slack-follow-ups/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"alert_type":{"type":"string","enum":["complaint","qa_score","routing","ticket_status"]},"title":{"type":"string","minLength":1},"summary":{"type":"string","minLength":1},"categories":{"type":"array","items":{"type":"string"}},"conversation_subject":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"agent_names":{"type":"array","items":{"type":"string"}},"assignee_name":{"type":"string","nullable":true},"assignee_email":{"type":"string","nullable":true},"assignee_slack_id":{"type":"string","nullable":true},"prior_complaint_count":{"type":"integer","minimum":0},"prior_complaint_titles":{"type":"array","items":{"type":"string"}},"prior_complaints":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"created_at":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true}},"required":["title"]}},"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"conversation_id":{"type":"string","nullable":true,"minLength":1},"conversation_external_id":{"type":"string","nullable":true}},"required":["title","summary","categories","conversation_subject","conversation_summary","agent_names","assignee_name","assignee_slack_id","prior_complaint_count","prior_complaint_titles"]}}}},"responses":{"200":{"description":"Complaint Slack follow-up generated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"text":{"type":"string"},"analysis":{"type":"object","properties":{"subjectType":{"type":"string","enum":["customer","vendor","client_vendor","unclear"],"description":"Whose failure this is: 'customer' when the customer or their own behaviour is the subject, 'vendor' when a provider we use failed, 'client_vendor' when a provider our client depends on failed, 'unclear' when the tools do not show which."},"escalationStatus":{"type":"string","enum":["known","new","unclear"],"description":"Whether a lookup actually returned an earlier case this repeats."},"message":{"type":"string","minLength":1,"maxLength":1500,"description":"The complete Slack reply, written as a teammate would post it, ending with one next-move question."}},"required":["subjectType","escalationStatus","message"]}},"required":["text","analysis"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Coaching sessions for an employee, or all sessions in the organization when agent_id is omitted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Agent memberships cannot list organization-wide sessions","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Employee not found or outside membership scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","minLength":1},"coached_at":{"type":"string","nullable":true,"format":"date-time"},"coach_id":{"type":"string","minLength":1},"priority":{"type":"string","enum":["low","medium","high"]},"notes":{"type":"string"},"feedback":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]},"maxItems":50},"evidence":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string","minLength":1},"qa_agent_evaluation_id":{"type":"string","nullable":true,"minLength":1},"feedback":{"type":"string","nullable":true}},"required":["conversation_id"]},"maxItems":50}},"required":["agent_id"]}}}},"responses":{"201":{"description":"Coaching session created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Referenced employee or evidence not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/count":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"start_at","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"end_at","in":"query"}],"responses":{"200":{"description":"Coaching sessions conducted for an employee or team in a period","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Employee not found or outside membership scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/upcoming":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50,"default":10},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["true","false"],"default":"true"},"required":false,"name":"include_overdue","in":"query"}],"responses":{"200":{"description":"Open scheduled coaching sessions for the current coach (overdue and upcoming)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/follow-up-scores":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"session_ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":200}},"required":["session_ids"]}}}},"responses":{"200":{"description":"Post-coaching QA scores for the requested sessions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"session_id":{"type":"string"},"follow_up_score":{"type":"integer","nullable":true},"baseline_score":{"type":"integer","nullable":true},"criterion_baselines":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"baseline_score":{"type":"integer","nullable":true},"average_score":{"type":"number","nullable":true},"average_max_score":{"type":"number","nullable":true},"evaluation_count":{"type":"integer","minimum":0},"auto_fail_count":{"type":"integer","minimum":0}},"required":["scorecard_criterion_id","baseline_score","average_score","average_max_score","evaluation_count","auto_fail_count"]}}},"required":["session_id","follow_up_score","baseline_score","criterion_baselines"]}}},"required":["data"]}}}},"403":{"description":"Agent memberships cannot access organization performance","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/criterion-baselines":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","minLength":1},"criterion_ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":50},"coached_at":{"type":"string","format":"date-time"}},"required":["agent_id","criterion_ids","coached_at"]}}}},"responses":{"200":{"description":"30-day pre-session QA baselines for the agent, criteria, and planned date","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"criterion_baselines":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"baseline_score":{"type":"integer","nullable":true},"average_score":{"type":"number","nullable":true},"average_max_score":{"type":"number","nullable":true},"evaluation_count":{"type":"integer","minimum":0},"auto_fail_count":{"type":"integer","minimum":0}},"required":["scorecard_criterion_id","baseline_score","average_score","average_max_score","evaluation_count","auto_fail_count"]}}},"required":["agent_id","criterion_baselines"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Employee not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/evaluated-criteria":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agent_id","in":"query"}],"responses":{"200":{"description":"Distinct scorecard criteria the agent has completed evaluation results for","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["data"]}}}},"400":{"description":"Invalid agent_id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Employee not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Coaching session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"coached_at":{"type":"string","nullable":true,"format":"date-time"},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coach_id":{"type":"string","minLength":1},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]},"maxItems":50}}}}}},"responses":{"200":{"description":"Coaching session updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Delivery state changed concurrently, or session is archived","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Coaching session deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}/performance":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Before/after QA scores, weekly trend, and marked-down criterion results for a coaching session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"session_id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"coached_at":{"type":"string"},"completed_at":{"type":"string"},"validation_end_at":{"type":"string"},"validation_state":{"type":"string","enum":["in_progress","improved","no_improvement","insufficient_data"]},"topic_label":{"type":"string","nullable":true},"window_label":{"type":"string"},"baseline_window_label":{"type":"string"},"before_window":{"type":"object","properties":{"start_at":{"type":"string"},"end_at":{"type":"string"}},"required":["start_at","end_at"]},"after_window":{"type":"object","properties":{"start_at":{"type":"string"},"end_at":{"type":"string"}},"required":["start_at","end_at"]},"before_score":{"type":"integer","nullable":true},"after_score":{"type":"integer","nullable":true},"before_evaluation_count":{"type":"integer","minimum":0},"after_evaluation_count":{"type":"integer","minimum":0},"weekly_series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"score":{"type":"integer","nullable":true},"evaluation_count":{"type":"integer","minimum":0},"phase":{"type":"string","enum":["before","after"]},"conversation_ids":{"type":"array","items":{"type":"string"}}},"required":["day","score","evaluation_count","phase","conversation_ids"]}},"marked_down":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"summary":{"type":"string"},"evaluated_at":{"type":"string"},"score":{"type":"integer","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","conversation_id","summary","evaluated_at","score","scorecard_criterion_id"]}},"performed_well":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"summary":{"type":"string"},"evaluated_at":{"type":"string"},"score":{"type":"integer","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","conversation_id","summary","evaluated_at","score","scorecard_criterion_id"]}},"criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"before_score":{"type":"integer","nullable":true},"after_score":{"type":"integer","nullable":true},"before_evaluation_count":{"type":"integer","minimum":0},"after_evaluation_count":{"type":"integer","minimum":0},"weekly_series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"score":{"type":"integer","nullable":true},"evaluation_count":{"type":"integer","minimum":0},"phase":{"type":"string","enum":["before","after"]},"conversation_ids":{"type":"array","items":{"type":"string"}}},"required":["day","score","evaluation_count","phase","conversation_ids"]}},"marked_down":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"summary":{"type":"string"},"evaluated_at":{"type":"string"},"score":{"type":"integer","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","conversation_id","summary","evaluated_at","score","scorecard_criterion_id"]}},"performed_well":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"summary":{"type":"string"},"evaluated_at":{"type":"string"},"score":{"type":"integer","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","conversation_id","summary","evaluated_at","score","scorecard_criterion_id"]}}},"required":["scorecard_criterion_id","label","before_score","after_score","before_evaluation_count","after_evaluation_count","weekly_series","marked_down","performed_well"]}}},"required":["session_id","agent_id","agent_name","coached_at","completed_at","validation_end_at","validation_state","topic_label","window_label","baseline_window_label","before_window","after_window","before_score","after_score","before_evaluation_count","after_evaluation_count","weekly_series","marked_down","performed_well","criteria"]}},"required":["data"]}}}},"400":{"description":"Coaching session has not been delivered","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}/archive":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Coaching session archive status updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}/unarchive":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Coaching session archive status updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Coaching session not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}/evidence":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evidence":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string","minLength":1},"qa_agent_evaluation_id":{"type":"string","nullable":true,"minLength":1},"feedback":{"type":"string","nullable":true}},"required":["conversation_id"]},"minItems":1,"maxItems":50}},"required":["evidence"]}}}},"responses":{"200":{"description":"Coaching session evidence added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Coaching session or evidence reference not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Archived coaching sessions cannot be edited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-sessions/{id}/evidence/{evidence_id}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"evidence_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"string","nullable":true}},"required":["feedback"]}}}},"responses":{"200":{"description":"Coaching session evidence updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Coaching session evidence not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Archived coaching sessions cannot be edited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"evidence_id","in":"path"}],"responses":{"200":{"description":"Coaching session evidence deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"agent_team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"qa_auto_failed":{"type":"boolean","nullable":true},"topic_criterion_scores":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number","nullable":true},"result_label":{"type":"string","nullable":true}},"required":["scorecard_criterion_id","label","score","result_label"]}},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","qa_auto_failed","topic_criterion_scores","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","agent_team","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","archived_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Coaching session evidence not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Archived coaching sessions cannot be edited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-proposed-sessions":{"get":{"parameters":[{"schema":{"type":"string","enum":["pending","approved","dismissed"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"List coaching proposed sessions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"week_start_date":{"type":"string"},"week_end_date":{"type":"string"},"scheduled_at":{"type":"string","nullable":true},"timezone":{"type":"string"},"status":{"type":"string","enum":["pending","approved","dismissed"]},"priority":{"type":"string","enum":["low","medium","high"]},"notes":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"fail_rate":{"type":"number"},"failed_count":{"type":"integer"},"evaluation_count":{"type":"integer"},"auto_failed_count":{"type":"integer"},"trigger_types":{"type":"array","items":{"type":"string","enum":["fail_rate","fail_count","any_auto_fail"]}},"baseline_score":{"type":"integer","nullable":true},"average_score":{"type":"number","nullable":true},"average_max_score":{"type":"number","nullable":true},"baseline_evaluation_count":{"type":"integer"},"auto_fail_count":{"type":"integer"}},"required":["scorecard_criterion_id","name","fail_rate","failed_count","evaluation_count","auto_failed_count","trigger_types","baseline_score","average_score","average_max_score","baseline_evaluation_count","auto_fail_count"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"qa_agent_evaluation_id":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true}},"required":["conversation_id","qa_agent_evaluation_id","external_id","subject","qa_score"]}},"coaching_session_id":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","team_name","week_start_date","week_end_date","scheduled_at","timezone","status","priority","notes","criteria","evidence","coaching_session_id","created_at","updated_at"]}}},"required":["data"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-proposed-sessions/{id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_at":{"type":"string","nullable":true,"format":"date-time"},"notes":{"type":"string"},"criterion_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated proposed session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"week_start_date":{"type":"string"},"week_end_date":{"type":"string"},"scheduled_at":{"type":"string","nullable":true},"timezone":{"type":"string"},"status":{"type":"string","enum":["pending","approved","dismissed"]},"priority":{"type":"string","enum":["low","medium","high"]},"notes":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"fail_rate":{"type":"number"},"failed_count":{"type":"integer"},"evaluation_count":{"type":"integer"},"auto_failed_count":{"type":"integer"},"trigger_types":{"type":"array","items":{"type":"string","enum":["fail_rate","fail_count","any_auto_fail"]}},"baseline_score":{"type":"integer","nullable":true},"average_score":{"type":"number","nullable":true},"average_max_score":{"type":"number","nullable":true},"baseline_evaluation_count":{"type":"integer"},"auto_fail_count":{"type":"integer"}},"required":["scorecard_criterion_id","name","fail_rate","failed_count","evaluation_count","auto_failed_count","trigger_types","baseline_score","average_score","average_max_score","baseline_evaluation_count","auto_fail_count"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"qa_agent_evaluation_id":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true}},"required":["conversation_id","qa_agent_evaluation_id","external_id","subject","qa_score"]}},"coaching_session_id":{"type":"string","nullable":true,"format":"uuid"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","team_name","week_start_date","week_end_date","scheduled_at","timezone","status","priority","notes","criteria","evidence","coaching_session_id","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-proposed-sessions/{id}/dismiss":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dismissed proposed session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["dismissed"]}},"required":["id","status"]}},"required":["data"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-proposed-sessions/{id}/approve":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"coached_at":{"type":"string","format":"date-time"},"coach_id":{"type":"string","minLength":1}}}}}},"responses":{"201":{"description":"Approved and created coaching session","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"created_by_membership_id":{"type":"string"},"created_by_name":{"type":"string","nullable":true},"coach_id":{"type":"string"},"coach_name":{"type":"string","nullable":true},"delivery_status":{"type":"string","enum":["assigned","scheduled","completed","canceled"]},"priority":{"type":"string","enum":["low","medium","high"]},"coached_at":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"notes":{"type":"string"},"feedback":{"type":"string"},"root_cause":{"type":"string"},"topics":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"scorecard_criterion_id":{"type":"string","nullable":true}},"required":["id","type","scorecard_criterion_id"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_external_url":{"type":"string","nullable":true},"qa_agent_evaluation_id":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"feedback":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","conversation_id","conversation_external_id","conversation_subject","conversation_external_url","qa_agent_evaluation_id","qa_score","feedback","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","agent_id","agent_name","created_by_membership_id","created_by_name","coach_id","coach_name","delivery_status","priority","coached_at","completed_at","notes","feedback","root_cause","topics","evidence","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/coaching-trigger-settings":{"get":{"responses":{"200":{"description":"Coaching trigger settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"general_enabled":{"type":"boolean"},"general_fail_rate_pct":{"type":"integer"},"general_min_evaluations":{"type":"integer"},"subscriber_membership_ids":{"type":"array","items":{"type":"string"}},"per_criterion":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"fail_rate_pct":{"type":"integer"},"min_evaluations":{"type":"integer"},"is_override":{"type":"boolean"}},"required":["scorecard_criterion_id","name","enabled","fail_rate_pct","min_evaluations","is_override"]}},"rules":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_rate"]},"fail_rate_pct":{"type":"integer","minimum":1,"maximum":100},"min_evaluations":{"type":"integer","minimum":1}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type","fail_rate_pct","min_evaluations"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_count"]},"fail_count":{"type":"integer","minimum":1}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type","fail_count"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["any_auto_fail"]}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type"]}]}},"available_criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"has_auto_fail":{"type":"boolean"}},"required":["scorecard_criterion_id","name","scorecard_name","has_auto_fail"]}},"available_criteria_groups":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"has_auto_fail":{"type":"boolean"}},"required":["scorecard_criterion_id","name","has_auto_fail"]}}},"required":["id","name","criteria"]}}},"required":["scorecard_id","scorecard_name","groups"]}}},"required":["general_enabled","general_fail_rate_pct","general_min_evaluations","subscriber_membership_ids","per_criterion","rules","available_criteria","available_criteria_groups"]}},"required":["data"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"general_enabled":{"type":"boolean"},"general_fail_rate_pct":{"type":"integer","minimum":1,"maximum":100},"general_min_evaluations":{"type":"integer","minimum":1,"maximum":1000},"subscriber_membership_ids":{"type":"array","items":{"type":"string"}},"per_criterion":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"enabled":{"type":"boolean"},"fail_rate_pct":{"type":"integer","minimum":1,"maximum":100},"min_evaluations":{"type":"integer","minimum":1,"maximum":1000}},"required":["scorecard_criterion_id","enabled","fail_rate_pct","min_evaluations"]}},"rules":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"],"default":"scheduled"},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_rate"]},"fail_rate_pct":{"type":"integer","minimum":1,"maximum":100},"min_evaluations":{"type":"integer","minimum":1}},"required":["id","enabled","priority","window_days","scorecard_criterion_ids","type","fail_rate_pct","min_evaluations"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"],"default":"scheduled"},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_count"]},"fail_count":{"type":"integer","minimum":1}},"required":["id","enabled","priority","window_days","scorecard_criterion_ids","type","fail_count"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"],"default":"scheduled"},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["any_auto_fail"]}},"required":["id","enabled","priority","window_days","scorecard_criterion_ids","type"]}]},"maxItems":20}},"required":["general_enabled","general_fail_rate_pct","general_min_evaluations","subscriber_membership_ids","per_criterion"]}}}},"responses":{"200":{"description":"Updated coaching trigger settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"general_enabled":{"type":"boolean"},"general_fail_rate_pct":{"type":"integer"},"general_min_evaluations":{"type":"integer"},"subscriber_membership_ids":{"type":"array","items":{"type":"string"}},"per_criterion":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"fail_rate_pct":{"type":"integer"},"min_evaluations":{"type":"integer"},"is_override":{"type":"boolean"}},"required":["scorecard_criterion_id","name","enabled","fail_rate_pct","min_evaluations","is_override"]}},"rules":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_rate"]},"fail_rate_pct":{"type":"integer","minimum":1,"maximum":100},"min_evaluations":{"type":"integer","minimum":1}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type","fail_rate_pct","min_evaluations"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["fail_count"]},"fail_count":{"type":"integer","minimum":1}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type","fail_count"]},{"type":"object","properties":{"id":{"type":"string","minLength":1},"enabled":{"type":"boolean"},"priority":{"type":"string","enum":["high","medium","low"]},"mode":{"type":"string","enum":["scheduled","immediate"]},"window_days":{"type":"integer","minimum":1,"maximum":365},"scorecard_criterion_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"type":{"type":"string","enum":["any_auto_fail"]}},"required":["id","enabled","priority","mode","window_days","scorecard_criterion_ids","type"]}]}},"available_criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"has_auto_fail":{"type":"boolean"}},"required":["scorecard_criterion_id","name","scorecard_name","has_auto_fail"]}},"available_criteria_groups":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string"},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string"},"name":{"type":"string"},"has_auto_fail":{"type":"boolean"}},"required":["scorecard_criterion_id","name","has_auto_fail"]}}},"required":["id","name","criteria"]}}},"required":["scorecard_id","scorecard_name","groups"]}}},"required":["general_enabled","general_fail_rate_pct","general_min_evaluations","subscriber_membership_ids","per_criterion","rules","available_criteria","available_criteria_groups"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Feature disabled","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-performance-reports":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"employee_id","in":"query"},{"schema":{"type":"string","enum":["daily","weekly"]},"required":false,"name":"report_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"sort","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Lean list of agent performance reports. Agents see only their own; managers/admins see the organization (optionally filtered by employee).","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"report_type":{"type":"string","enum":["daily","weekly"]},"processing_status":{"type":"string","enum":["pending","in_progress","completed","failed"]},"start_date":{"type":"string"},"end_date":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","report_type","processing_status","start_date","end_date","created_at","updated_at"]}}},"required":["data"]}}}},"503":{"description":"Unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-performance-reports/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Full agent performance report with ordered citations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"report_type":{"type":"string","enum":["daily","weekly"]},"processing_status":{"type":"string","enum":["pending","in_progress","completed","failed"]},"start_date":{"type":"string"},"end_date":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"summary":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"average_qa_score":{"type":"number","nullable":true},"previous_average_qa_score":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"previous_average_handling_time":{"type":"number","nullable":true},"conversations_count":{"type":"number","nullable":true},"closed_conversations_count":{"type":"number","nullable":true},"resolved_conversations_count":{"type":"number","nullable":true},"previous_conversations_count":{"type":"number","nullable":true},"previous_resolved_conversations_count":{"type":"number","nullable":true},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]},"citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"type":{"type":"string","enum":["low_qa_score","high_qa_score"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","citation_index","type","conversation_id","work_item_id","created_at","updated_at"]}}},"required":["id","report_type","processing_status","start_date","end_date","created_at","updated_at","summary","content","average_qa_score","previous_average_qa_score","average_qa_score_delta","average_handling_time","previous_average_handling_time","conversations_count","closed_conversations_count","resolved_conversations_count","previous_conversations_count","previous_resolved_conversations_count","employee","citations"]}},"required":["data"]}}}},"404":{"description":"Report not found or not visible to the caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent_knowledge_gap_reports":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Agent knowledge gap reports for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"week_start_date":{"type":"string"},"week_end_date":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"knowledge_gaps_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","week_start_date","week_end_date","status","knowledge_gaps_count","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent_knowledge_gap_reports/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An agent knowledge gap report with its gaps and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"week_start_date":{"type":"string"},"week_end_date":{"type":"string"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"knowledge_gaps_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]},"agent_knowledge_gaps":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"evidence_count":{"type":"integer"},"conversations_count":{"type":"integer"},"employees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","name"]}},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_subject":{"type":"string","nullable":true},"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true}},"required":["id","conversation_id","conversation_subject","employee_id","employee_name"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","evidence_count","conversations_count","employees","evidences","created_at","updated_at"]}}},"required":["id","week_start_date","week_end_date","status","knowledge_gaps_count","created_at","updated_at","organization","agent_knowledge_gaps"]}},"required":["data"]}}}},"404":{"description":"Agent knowledge gap report not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calls":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"conversation_id","in":"query"}],"responses":{"200":{"description":"The signed-in member's recent calls with their agent summary, newest first, optionally narrowed to one conversation.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"number","nullable":true},"direction":{"type":"string","nullable":true},"customer_name":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"conversation":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"external_url":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","external_id","external_url","subject"]},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","name"]},"summary":{"type":"string","nullable":true},"summary_generated_at":{"type":"string","nullable":true},"transcribed_at":{"type":"string","nullable":true}},"required":["id","started_at","ended_at","duration_ms","direction","customer_name","company_name","conversation","agent","summary","summary_generated_at","transcribed_at"]}}},"required":["data"]}}}},"503":{"description":"Unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calls/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"One call with its agent summary and transcript","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"number","nullable":true},"direction":{"type":"string","nullable":true},"customer_name":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"conversation":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"external_url":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","external_id","external_url","subject"]},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","name"]},"summary":{"type":"string","nullable":true},"summary_generated_at":{"type":"string","nullable":true},"transcribed_at":{"type":"string","nullable":true},"transcript":{"type":"array","items":{"type":"object","properties":{"speaker":{"type":"string","enum":["agent","customer","unknown"]},"text":{"type":"string"},"start_ms":{"type":"integer","minimum":0}},"required":["speaker","text","start_ms"]}}},"required":["id","started_at","ended_at","duration_ms","direction","customer_name","company_name","conversation","agent","summary","summary_generated_at","transcribed_at","transcript"]}},"required":["data"]}}}},"404":{"description":"Call not found or not visible to the caller","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa-agent-evaluations/{qa_agent_evaluation_id}/criterion-comment-threads":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"qa_agent_evaluation_id","in":"path"}],"responses":{"200":{"description":"Criterion comment thread summaries for an evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"criterion_result_id":{"type":"string"},"conversation_id":{"type":"string"},"qa_agent_evaluation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"latest_message_at":{"type":"string","nullable":true}},"required":["id","criterion_result_id","conversation_id","qa_agent_evaluation_id","message_count","has_unread","is_subscriber","participants","latest_message_at"]}}},"required":["data"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/criterion-comment-threads/{criterion_result_id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"criterion_result_id","in":"path"}],"responses":{"200":{"description":"Criterion comment thread detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"criterion_result_id":{"type":"string"},"conversation_id":{"type":"string"},"qa_agent_evaluation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"latest_message_at":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at"]}}},"required":["id","criterion_result_id","conversation_id","qa_agent_evaluation_id","message_count","has_unread","is_subscriber","participants","latest_message_at","messages"]}},"required":["data"]}}}},"404":{"description":"Criterion result not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/criterion-comment-threads/{criterion_result_id}/messages":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"criterion_result_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body_markdown":{"type":"string","minLength":1}},"required":["body_markdown"]}}}},"responses":{"201":{"description":"Created criterion comment message","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"criterion_result_id":{"type":"string"},"conversation_id":{"type":"string"},"qa_agent_evaluation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"latest_message_at":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at"]}}},"required":["id","criterion_result_id","conversation_id","qa_agent_evaluation_id","message_count","has_unread","is_subscriber","participants","latest_message_at","messages"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Criterion result not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/criterion-comment-threads/{criterion_result_id}/read":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"criterion_result_id","in":"path"}],"responses":{"200":{"description":"Marked criterion comment thread as read","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}},"required":["data"]}}}},"404":{"description":"Criterion result not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/comment-visibility-options":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"conversation_id","in":"path"}],"responses":{"200":{"description":"VISIBLE TO options for ticket comments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"include_non_agents_label":{"type":"string","enum":["Admins"]},"agents":{"type":"array","items":{"type":"object","properties":{"employee_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["employee_id","name","email"]}}},"required":["include_non_agents_label","agents"]}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/comment-threads":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"conversation_id","in":"path"}],"responses":{"200":{"description":"Ticket comment threads visible to the viewer","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}},"required":["include_non_agents","employee_ids"]},"latest_message_at":{"type":"string","nullable":true},"latest_message_body_text":{"type":"string","nullable":true},"latest_message_body_markdown":{"type":"string","nullable":true},"latest_message_author_name":{"type":"string","nullable":true},"latest_message_author_membership_id":{"type":"string","nullable":true},"latest_message_id":{"type":"string","nullable":true}},"required":["id","conversation_id","message_count","has_unread","is_subscriber","participants","visibility","latest_message_at","latest_message_body_text","latest_message_body_markdown","latest_message_author_name","latest_message_author_membership_id","latest_message_id"]}}},"required":["data"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body_markdown":{"type":"string","minLength":1},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}}}},"required":["body_markdown"]}}}},"responses":{"201":{"description":"Created ticket comment thread","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}},"required":["include_non_agents","employee_ids"]},"latest_message_at":{"type":"string","nullable":true},"latest_message_body_text":{"type":"string","nullable":true},"latest_message_body_markdown":{"type":"string","nullable":true},"latest_message_author_name":{"type":"string","nullable":true},"latest_message_author_membership_id":{"type":"string","nullable":true},"latest_message_id":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at","updated_at"]}}},"required":["id","conversation_id","message_count","has_unread","is_subscriber","participants","visibility","latest_message_at","latest_message_body_text","latest_message_body_markdown","latest_message_author_name","latest_message_author_membership_id","latest_message_id","messages"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-comment-threads/{thread_id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"thread_id","in":"path"}],"responses":{"200":{"description":"Ticket comment thread detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}},"required":["include_non_agents","employee_ids"]},"latest_message_at":{"type":"string","nullable":true},"latest_message_body_text":{"type":"string","nullable":true},"latest_message_body_markdown":{"type":"string","nullable":true},"latest_message_author_name":{"type":"string","nullable":true},"latest_message_author_membership_id":{"type":"string","nullable":true},"latest_message_id":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at","updated_at"]}}},"required":["id","conversation_id","message_count","has_unread","is_subscriber","participants","visibility","latest_message_at","latest_message_body_text","latest_message_body_markdown","latest_message_author_name","latest_message_author_membership_id","latest_message_id","messages"]}},"required":["data"]}}}},"404":{"description":"Thread not found or not visible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-comment-threads/{thread_id}/messages":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"thread_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body_markdown":{"type":"string","minLength":1}},"required":["body_markdown"]}}}},"responses":{"201":{"description":"Created ticket comment reply","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}},"required":["include_non_agents","employee_ids"]},"latest_message_at":{"type":"string","nullable":true},"latest_message_body_text":{"type":"string","nullable":true},"latest_message_body_markdown":{"type":"string","nullable":true},"latest_message_author_name":{"type":"string","nullable":true},"latest_message_author_membership_id":{"type":"string","nullable":true},"latest_message_id":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at","updated_at"]}}},"required":["id","conversation_id","message_count","has_unread","is_subscriber","participants","visibility","latest_message_at","latest_message_body_text","latest_message_body_markdown","latest_message_author_name","latest_message_author_membership_id","latest_message_id","messages"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Thread not found or not visible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-comment-threads/{thread_id}/messages/{message_id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"thread_id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"message_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body_markdown":{"type":"string","minLength":1}},"required":["body_markdown"]}}}},"responses":{"200":{"description":"Updated ticket comment message","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"message_count":{"type":"integer"},"has_unread":{"type":"boolean"},"is_subscriber":{"type":"boolean"},"participants":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"}},"required":["membership_id","name"]}},"visibility":{"type":"object","properties":{"include_non_agents":{"type":"boolean"},"employee_ids":{"type":"array","items":{"type":"string"}}},"required":["include_non_agents","employee_ids"]},"latest_message_at":{"type":"string","nullable":true},"latest_message_body_text":{"type":"string","nullable":true},"latest_message_body_markdown":{"type":"string","nullable":true},"latest_message_author_name":{"type":"string","nullable":true},"latest_message_author_membership_id":{"type":"string","nullable":true},"latest_message_id":{"type":"string","nullable":true},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"body_markdown":{"type":"string"},"body_text":{"type":"string"},"author":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","body_markdown","body_text","author","created_at","updated_at"]}}},"required":["id","conversation_id","message_count","has_unread","is_subscriber","participants","visibility","latest_message_at","latest_message_body_text","latest_message_body_markdown","latest_message_author_name","latest_message_author_membership_id","latest_message_id","messages"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Not the message author","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Thread or message not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"thread_id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"message_id","in":"path"}],"responses":{"200":{"description":"Deleted ticket comment message","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted":{"type":"boolean","enum":[true]}},"required":["deleted"]}},"required":["data"]}}}},"403":{"description":"Not the message author","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Thread or message not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-comment-threads/{thread_id}/read":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"thread_id","in":"path"}],"responses":{"200":{"description":"Marked ticket comment thread as read","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}},"required":["data"]}}}},"404":{"description":"Thread not found or not visible","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa-eligibility-rules":{"get":{"responses":{"200":{"description":"Configured QA eligibility rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["ticket_tags"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["customers"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["prompt"]},"instructions":{"type":"string"}},"required":["id","type","instructions"]}]},"maxItems":20}},"required":["rules"]}},"required":["data"]}}}}}},"put":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["ticket_tags"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["customers"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["prompt"]},"instructions":{"type":"string"}},"required":["id","type","instructions"]}]},"maxItems":20}},"required":["rules"]}}}},"responses":{"200":{"description":"Updated QA eligibility rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rules":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["ticket_tags"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["customers"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["prompt"]},"instructions":{"type":"string"}},"required":["id","type","instructions"]}]},"maxItems":20}},"required":["rules"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/qa_eligibility/check":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversationXml":{"type":"string","minLength":1},"railsOrganizationId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"customEligibilityInstructions":{"type":"string","nullable":true},"eligibilityRules":{"type":"array","nullable":true,"items":{"oneOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["ticket_tags"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["customers"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string","minLength":1},"maxItems":100}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["prompt"]},"instructions":{"type":"string"}},"required":["id","type","instructions"]}]},"maxItems":20},"conversationAttributes":{"type":"object","nullable":true,"properties":{"ticketTags":{"type":"array","nullable":true,"items":{"type":"string"}},"customerIds":{"type":"array","nullable":true,"items":{"type":"string"}}}},"candidateAgentIds":{"type":"array","items":{"type":"string"}},"evaluationModel":{"type":"string","nullable":true},"evaluationReasoningEffort":{"type":"string","nullable":true},"metadata":{"type":"object","properties":{"conversation_id":{"type":"string"},"employee_id":{"type":"string"},"organization_id":{"type":"string"},"qa_evaluation_id":{"type":"string"},"qa_evaluation_request_id":{"type":"string"},"source":{"type":"string"},"user_requested":{"type":"boolean"}},"additionalProperties":{"nullable":true}},"executionMode":{"type":"string","enum":["production","diagnostic"]}},"required":["conversationXml"]}}}},"responses":{"200":{"description":"Eligibility verdict from deterministic and AI rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"eligible_agent_ids":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"},"rule_results":{"type":"array","items":{"type":"object","properties":{"rule_id":{"type":"string"},"type":{"type":"string","enum":["ticket_tags","customers","prompt"]},"status":{"type":"string","enum":["passed","failed","not_run"]},"reason":{"type":"string"},"matched_values":{"type":"array","items":{"type":"string"}}},"required":["rule_id","type","status","reason","matched_values"]}}},"required":["eligible_agent_ids","reason","rule_results"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Upstream eligibility service (OpenAI / AI SDK) failed; caller should retry. Never returned for legitimate ineligibility verdicts.","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List scorecards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Scorecard"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scorecard":{"$ref":"#/components/schemas/ScorecardFormParams"}},"required":["scorecard"]}}}},"responses":{"201":{"description":"Scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardFull"}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Application error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["title","code","detail"]}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workspaces/{workspace_id}/scorecards":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"workspace_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List scorecards in a workspace","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Scorecard"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Workspace not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"workspace_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scorecard":{"$ref":"#/components/schemas/ScorecardFormParams"}},"required":["scorecard"]}}}},"responses":{"201":{"description":"Scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardFull"}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Application error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["title","code","detail"]}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardFull"}},"required":["data"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scorecard":{"$ref":"#/components/schemas/ScorecardFormParams"}},"required":["scorecard"]}}}},"responses":{"200":{"description":"Scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardFull"}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Stale lock_version","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["title","code","detail"]}}},"required":["errors"]}}}},"422":{"description":"Application error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["title","code","detail"]}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Scorecard archived"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/evaluation_results":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_before","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"agent_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"group_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"team_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Scorecard evaluation results","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardEvaluationResultSummary"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/evaluation_results/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_before","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"agent_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"group_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"team_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Daily scorecard evaluation statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardEvaluationStatistic"}}},"required":["data"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_evaluation_results/default_filters":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"conversation_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_before","in":"query"}],"responses":{"200":{"description":"Default scorecard/team pair for evaluation result filters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScorecardEvaluationDefaultFilters"}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{id}/adherence_by_criteria":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Per-criterion pass/partial/fail counts in tree order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"criteria_adherence_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterionAdherence"}}},"required":["criteria_adherence_breakdown"]}},"required":["data"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/ticket_resolution_resolvers":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Resolvers who resolved conversations on the given day","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TicketResolutionResolverStatistic"}}},"required":["data"]}}}},"400":{"description":"Invalid date format","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/contested_evaluations_by_date":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Evaluation contests raised on the given day","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ContestedEvaluationStatistic"}}},"required":["data"]}}}},"400":{"description":"Invalid date format","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/applicable_scorecards":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scorecards applicable to or already used on the conversation, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardFull"}}},"required":["data"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria/{scorecard_criterion_id}/evaluation_scorecard_criterion_results":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_criterion_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_before","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"team_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"employee_id","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Active criterion results for the criterion (summary view)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterionResultSummary"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Scorecard criterion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria/{scorecard_criterion_id}/evaluation_scorecard_criterion_results/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_criterion_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_started_before","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"team_ids","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"employee_id","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"data_source_id","in":"query"}],"responses":{"200":{"description":"Daily criterion result statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterionResultStatistic"}}},"required":["data"]}}}},"404":{"description":"Scorecard criterion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria/{scorecard_criterion_id}/qa_agent_evaluation_scorecard_criterion_results":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_criterion_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Effective criterion results for the criterion (full view)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/QaAgentEvaluationScorecardCriterionResult"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed `filter` JSON","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Scorecard criterion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_sections":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"List scorecard sections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardSection"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/versions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Scorecard versions, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardVersion"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/versions/publish":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"lock_version":{"type":"integer","nullable":true}}}}}},"responses":{"201":{"description":"Published version","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardVersion"}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Stale lock_version","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["title","code","detail"]}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/versions/{id}/restore":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scorecard restored to the version's snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardFull"}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criterion_score_option_justification_options/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"criterion_description":{"type":"string","minLength":1},"check_description":{"type":"string","minLength":1},"criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"label":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"value":{"nullable":true}},"required":["id","label","type"]}},"criterion_instructions":{"type":"string","nullable":true},"check_justification_options":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string","minLength":1},"score_option_id":{"type":"string","minLength":1}},"required":["content","score_option_id"]}},"check_conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","minLength":1},"value":{"type":"array","items":{"type":"string"}}},"required":["field","value"]}}},"required":["criterion_description","check_description","criterion_score_options"]}}}},"responses":{"200":{"description":"Generated justification option suggestions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"content":{"type":"string"},"score_option_id":{"type":"string"}},"required":["content","score_option_id"]}}},"required":["data"]}}}},"400":{"description":"Invalid generation input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Generation provider failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criterion_checks/{scorecard_criterion_check_id}/scorecard_criterion_score_option_justification_options":{"post":{"operationId":"createScorecardCriterionCheckJustificationOption","parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_criterion_check_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scorecard_criterion_score_option_justification_option":{"type":"object","properties":{"content":{"type":"string","nullable":true},"scorecard_criterion_score_option_id":{"type":"string","nullable":true}}}},"required":["scorecard_criterion_score_option_justification_option"]}}}},"responses":{"201":{"description":"Justification option created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score_option_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"check_id":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"nullable":true}},"required":["id","type","content","created_at","updated_at","score_option_id","full_name","check_id","criterion_id"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Check not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid score option","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"List scorecard criteria","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterion"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/scorecard_criteria":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"List the criteria of a scorecard","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterion"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scorecard criterion","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ScorecardCriterion"}},"required":["data"]}}}},"404":{"description":"Scorecard criterion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criterion_score_option_justification_options/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Justification option","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score_option_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"check_id":{"type":"string","nullable":true},"criterion_id":{"type":"string","nullable":true},"values":{"nullable":true}},"required":["id","type","content","created_at","updated_at","score_option_id","full_name","check_id","criterion_id"]}},"required":["data"]}}}},"404":{"description":"Justification option not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/evaluations/enqueue":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"organization_slug":{"type":"string"}},"required":["qa_evaluation_id","organization_slug"]}}}},"responses":{"202":{"description":"Evaluation job enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"},"resultRunId":{"type":"string"}},"required":["jobId","resultRunId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/evaluations/attachment_caption":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"attachment_id":{"type":"string"},"conversation_part_id":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"integer","nullable":true,"minimum":0},"file_url":{"type":"string","format":"uri"}},"required":["attachment_id","conversation_part_id","filename","file_url"]}}}},"responses":{"200":{"description":"Attachment caption generated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"caption_status":{"type":"string","enum":["completed","unsupported","failed"]},"caption":{"type":"string","nullable":true},"caption_error":{"type":"string","nullable":true},"should_tombstone_attachment":{"type":"boolean"}},"required":["caption_status","caption","caption_error","should_tombstone_attachment"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_scorecard_criterion_results/{evaluation_scorecard_criterion_result_id}/evaluation_scorecard_criterion_result_comments":{"get":{"tags":["Evaluation feedback comments"],"operationId":"listEvaluationScorecardCriterionResultComments","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"evaluation_scorecard_criterion_result_id","in":"path"}],"responses":{"200":{"description":"Comments on the criterion result, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationScorecardCriterionResultComment"}}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Evaluation feedback comments"],"operationId":"createEvaluationScorecardCriterionResultComment","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"evaluation_scorecard_criterion_result_id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationScorecardCriterionResultCommentBody"}}}},"responses":{"201":{"description":"Comment created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EvaluationScorecardCriterionResultComment"}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationFeedbackCommentValidationErrors"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Idempotency-Key reused with a different body","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_scorecard_criterion_result_comments/{id}":{"patch":{"tags":["Evaluation feedback comments"],"operationId":"updateEvaluationScorecardCriterionResultComment","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationScorecardCriterionResultCommentBody"}}}},"responses":{"200":{"description":"Comment updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EvaluationScorecardCriterionResultComment"}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationFeedbackCommentValidationErrors"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Evaluation feedback comments"],"operationId":"deleteEvaluationScorecardCriterionResultComment","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Comment deleted","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_scorecard_criterion_result_comments/{id}/apply":{"post":{"tags":["Evaluation feedback comments"],"operationId":"applyEvaluationScorecardCriterionResultComment","parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Feedback re-evaluation queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"processing_status":{"type":"string"}},"required":["id","processing_status"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/redaction/derived_text":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rails_organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"text":{"type":"string"}},"required":["rails_organization_id","text"]}}}},"responses":{"200":{"description":"Redacted text","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"text":{"type":"string"}},"required":["text"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Redaction failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa-agent-evaluations/{id}/mark-read":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Evaluation marked as read (or already read)"},"400":{"description":"Invalid evaluation id","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Evaluation not found or caller is not the evaluated agent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_contests":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Cursor-paginated evaluation contests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"contested_evaluation_score":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_review_status":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"work_item_review_status":{"type":"string","nullable":true},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","avatar_url"]}},"required":["id","status","outcome","display_outcome","contest_level","contested_evaluation_score","created_at","updated_at","conversation_id","conversation_external_id","conversation_summary","conversation_review_status","work_item_id","work_item_external_id","work_item_summary","work_item_review_status","conversation_assignee","employee"]}},"page":{"type":"object","properties":{"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["next_cursor","has_more"]}},"required":["data","page"]}}}},"400":{"description":"Invalid filter or cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_contests/counts":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"groups","in":"query"}],"responses":{"200":{"description":"Filtered total plus one count per requested group","content":{"application/json":{"schema":{"type":"object","properties":{"total":{"type":"integer"},"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}},"required":["value","count"]}}},"required":["total","data"]}}}},"400":{"description":"Invalid filter or groups","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_contests/navigation":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"work_item_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"contest_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"groups","in":"query"}],"responses":{"200":{"description":"Previous/next contest around the current contest","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previous_id":{"type":"string","nullable":true},"next_id":{"type":"string","nullable":true},"previous_contest_id":{"type":"string","nullable":true},"next_contest_id":{"type":"string","nullable":true},"previous_work_item_id":{"type":"string","nullable":true},"next_work_item_id":{"type":"string","nullable":true}},"required":["previous_id","next_id","previous_contest_id","next_contest_id","previous_work_item_id","next_work_item_id"]}},"required":["data"]}}}},"400":{"description":"Invalid filter or groups","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_agent_evaluations":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string","enum":["evaluation_date","contest_date"],"default":"evaluation_date"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"}],"responses":{"200":{"description":"Cursor-paginated organization-scoped QA agent evaluations. `total` is only computed for the first page.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest"]}},"page":{"type":"object","properties":{"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"},"total":{"type":"integer","nullable":true}},"required":["next_cursor","has_more","total"]}},"required":["data","page"]}}}},"400":{"description":"Invalid filter or cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_agent_evaluations/statistics":{"get":{"summary":"Get QA evaluation score statistics","tags":["QA agent evaluations"],"parameters":[{"schema":{"type":"string","format":"date"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string","enum":["conversation","work_item","back_office"]},"required":false,"name":"subject_type","in":"query"}],"responses":{"200":{"description":"Current and previous period QA score averages, plus current daily scores.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"average_score_change":{"type":"number","nullable":true},"average_score_by_date":{"type":"object","additionalProperties":{"type":"number"}}},"required":["average_score","previous_average_score","average_score_change","average_score_by_date"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/qa_agent_evaluations":{"get":{"summary":"List QA agent evaluations for a conversation","tags":["QA agent evaluations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"string","description":"JSON-encoded QA agent evaluation filters"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"QA agent evaluations for the conversation, newest first. All matching evaluations are returned, so `meta.page.next` is always null.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_agent_evaluations/{id}":{"get":{"summary":"Get a QA agent evaluation","tags":["QA agent evaluations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"QA agent evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}},"required":["data"]}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"summary":"Remove a QA agent evaluation from its ticket","tags":["QA agent evaluations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"QA agent evaluation removed"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/identity":{"get":{"tags":["Identity"],"summary":"Get API key identity","description":"Returns the organization identity authenticated by the API key.","operationId":"getIdentity","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Authenticated organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workos_organization_id":{"type":"string","nullable":true},"timezone":{"type":"string"}},"required":["id","name","workos_organization_id","timezone"]}},"required":["organization"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/organization":{"get":{"tags":["Organization"],"summary":"Get the current organization","description":"Returns safe metadata for the organization authenticated by the API key.","operationId":"getCurrentOrganization","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Authenticated organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"workos_organization_id":{"type":"string","nullable":true},"timezone":{"type":"string"}},"required":["id","name","workos_organization_id","timezone"]}},"required":["organization"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/conversation_uploads/{id}":{"get":{"tags":["Conversation uploads"],"summary":"Get a conversation upload","description":"Retrieves a conversation upload by its Rulebase upload ID.","operationId":"getConversationUpload","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Conversation upload","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","expired","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","created_at","updated_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation upload not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/conversation_uploads/presign":{"post":{"tags":["Conversation uploads"],"summary":"Generate a presigned URL for conversation upload","description":"Generates a presigned URL that can be used to upload conversations. The URL expires in 30 minutes.","operationId":"generatePresignedUrlForConversationUpload","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"filename":{"type":"string","description":"The archive filename, including its extension."},"source":{"type":"string","enum":["outreach_kaia","xcally"]}},"required":["filename","source"]}},"required":["upload"]}}}},"responses":{"200":{"description":"Presigned upload URL","content":{"application/json":{"schema":{"type":"object","properties":{"upload":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string","format":"uri"}},"required":["id","url"]}},"required":["upload"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/conversation_uploads":{"post":{"tags":["Conversation uploads"],"summary":"Upload a conversation","description":"Uploads one conversation as multipart form data. Use this endpoint for recordings up to 100 MB.","operationId":"uploadConversation","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"upload[source]":{"type":"string","enum":["outreach_kaia","xcally"]},"upload[metadata][unique_id]":{"type":"string"},"upload[metadata][type]":{"type":"string","enum":["inbound","outbound"]},"upload[metadata][agent]":{"type":"string"},"upload[metadata][caller]":{"type":"string"},"upload[metadata][called]":{"type":"string"},"upload[metadata][recorded_at]":{"type":"string"},"upload[file]":{"type":"string","format":"binary"}},"required":["upload[source]","upload[metadata][unique_id]","upload[metadata][type]","upload[metadata][agent]","upload[metadata][caller]","upload[metadata][called]","upload[metadata][recorded_at]","upload[file]"]}}}},"responses":{"201":{"description":"Conversation uploaded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","processing","completed","expired","failed"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","created_at","updated_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"tags":["Conversation uploads"],"summary":"List conversation uploads","description":"Returns conversation uploads for the organization.","operationId":"listConversationUploads","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"source","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"external_id","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updated_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updated_before","in":"query"}],"responses":{"200":{"description":"Conversation uploads","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"source":{"type":"string"},"external_id":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","source","external_id","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filters or pagination cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/evaluations":{"get":{"tags":["Evaluations"],"summary":"List evaluations","description":"Returns agent evaluations.","operationId":"listEvaluations","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"source_channel","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updated_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"updated_before","in":"query"}],"responses":{"200":{"description":"Active agent evaluations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]},"score":{"type":"number","nullable":true,"minimum":0,"maximum":100},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"}},"required":["id","key","name"]},"value":{"nullable":true}},"required":["id","field"]}}},"required":["id","external_id","field_values"]},"work_item":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"type":{"type":"string"}},"required":["id","external_id","type"]}},"required":["id","source","agent","score","created_at","updated_at","conversation","work_item"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filters or pagination cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items":{"post":{"tags":["Work items"],"summary":"Create a work item","description":"Create a work item. Fails with 409 when the external ID already exists; use PATCH or batch apply to update.","operationId":"createWorkItem","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_item":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"agent_email":{"type":"string","format":"email"},"agent_name":{"type":"string","minLength":1},"agent_external_id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"events":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"actor_email":{"type":"string","format":"email"},"actor_name":{"type":"string","minLength":1},"actor_external_id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["external_id"]},"default":[]}},"required":["external_id"]}},"required":["work_item"]}}}},"responses":{"201":{"description":"Work item created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["id","external_id","agent","agents","type","status","short_description","description","completed_at","custom_attributes","events","created_at","updated_at","qa_score"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"A work item with this external ID already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid work item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"tags":["Work items"],"summary":"List work items","description":"List work items newest-completion-first. Pass the returned `meta.page.next` cursor to fetch the following page. Deleted work items are excluded.","operationId":"listWorkItems","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"external_id","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_before","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Work items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["id","external_id","agent","agents","type","status","short_description","description","completed_at","custom_attributes","created_at","updated_at","qa_score"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid query","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items/{id}":{"patch":{"tags":["Work items"],"summary":"Update a work item","description":"Update a work item. Omitted fields keep their stored values, `custom_attributes` are merged, and `external_id` is immutable.","operationId":"updateWorkItem","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_item":{"type":"object","properties":{"agent_email":{"type":"string","format":"email"},"agent_name":{"type":"string","minLength":1},"agent_external_id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}}},"additionalProperties":false}},"required":["work_item"]}}}},"responses":{"200":{"description":"Work item updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["id","external_id","agent","agents","type","status","short_description","description","completed_at","custom_attributes","events","created_at","updated_at","qa_score"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid work item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Work items"],"summary":"Delete a work item","description":"Soft-delete a work item. Idempotent: deleting an already-deleted or unknown work item still returns 200 with `deleted: false`. Re-applying the same external ID restores it.","operationId":"deleteWorkItem","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Work item deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"deleted":{"type":"boolean"}},"required":["id","deleted"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"tags":["Work items"],"summary":"Get a work item","description":"Retrieve a work item by its ID.","operationId":"getWorkItem","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Work item found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["id","external_id","agent","agents","type","status","short_description","description","completed_at","custom_attributes","events","created_at","updated_at","qa_score"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items/batch":{"post":{"tags":["Work items"],"summary":"Apply a batch of work items","description":"Create, update, or restore up to 100 work items by external ID. Results preserve input order; a failed item does not roll back the others, and omitted work items are never deleted. Set `dry_run` to preview the outcome without writing.","operationId":"applyWorkItems","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_items":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"agent_email":{"type":"string","format":"email"},"agent_name":{"type":"string","minLength":1},"agent_external_id":{"type":"string","minLength":1},"type":{"type":"string","minLength":1},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"events":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"actor_email":{"type":"string","format":"email"},"actor_name":{"type":"string","minLength":1},"actor_external_id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["external_id"]},"default":[]}},"required":["external_id"]},"minItems":1,"maxItems":100},"dry_run":{"type":"boolean","default":false}},"required":["work_items"]}}}},"responses":{"200":{"description":"Batch applied","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"dry_run":{"type":"boolean"},"summary":{"type":"object","properties":{"total":{"type":"integer"},"created":{"type":"integer"},"updated":{"type":"integer"},"unchanged":{"type":"integer"},"restored":{"type":"integer"},"error":{"type":"integer"}},"required":["total","created","updated","unchanged","restored","error"]},"results":{"type":"array","items":{"type":"object","properties":{"index":{"type":"integer"},"external_id":{"type":"string"},"status":{"type":"string","enum":["created","updated","unchanged","restored","error"]},"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["id","external_id","agent","agents","type","status","short_description","description","completed_at","custom_attributes","created_at","updated_at","qa_score"]},"error":{"type":"string","nullable":true}},"required":["index","external_id","status","data","error"]}}},"required":["dry_run","summary","results"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid work item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items/upload/{id}":{"get":{"tags":["Work items"],"summary":"Get a work item upload","description":"Retrieve a work item upload by its ID to check processing status.","operationId":"getWorkItemUpload","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Work item upload found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"total_rows":{"type":"integer"},"succeeded_rows":{"type":"integer"},"failed_rows":{"type":"integer"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","total_rows","succeeded_rows","failed_rows","error","created_at","updated_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item upload not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items/upload":{"post":{"tags":["Work items"],"summary":"Upload work items in bulk","description":"Upload work items from a CSV file.","operationId":"uploadWorkItems","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"upload[file]":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Work item upload accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"total_rows":{"type":"integer"},"succeeded_rows":{"type":"integer"},"failed_rows":{"type":"integer"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","total_rows","succeeded_rows","failed_rows","error","created_at","updated_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid upload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/work_items/{id}/events":{"post":{"tags":["Work items"],"summary":"Create or update a work item event","description":"Create or update an event associated with a work item. Events are upserted by external ID.","operationId":"upsertWorkItemEvent","security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"actor_email":{"type":"string","format":"email"},"actor_name":{"type":"string","minLength":1},"actor_external_id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["external_id"]}},"required":["event"]}}}},"responses":{"201":{"description":"Work item event created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid work item event","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Rate limit exceeded. Retry after the number of seconds in the Retry-After header.","headers":{"Retry-After":{"schema":{"type":"string"},"description":"Seconds to wait before retrying"}},"content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/v1/agent_releases":{"post":{"tags":["Agent releases"],"summary":"Record an agent release","description":"Records that a new version of an agent was deployed. Call it from CI after each production deploy. Sending the same `commit_sha` (or, without one, the same `name`) again returns the existing release, so retries are safe.","operationId":"createAgentRelease","security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_id":{"type":"string","format":"uuid","description":"The agent's ID, from Settings → Agents."},"name":{"type":"string","minLength":1,"maxLength":120,"description":"Version label shown in Agent monitoring, e.g. v1.4.2."},"released_at":{"type":"string","format":"date-time","description":"When the deploy finished. Defaults to now."},"commit_sha":{"type":"string","minLength":7,"maxLength":64},"notes":{"type":"string","maxLength":2000}},"required":["agent_id","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"A release for this commit or name already exists","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"released_at":{"type":"string","nullable":true,"format":"date-time"},"released_on":{"type":"string"},"commit_sha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}},"required":["id","agent_id","name","released_at","released_on","commit_sha","notes"]}},"required":["data"]}}}},"201":{"description":"Release recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"agent_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"released_at":{"type":"string","nullable":true,"format":"date-time"},"released_on":{"type":"string"},"commit_sha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true}},"required":["id","agent_id","name","released_at","released_on","commit_sha","notes"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/employee_profiles/sync":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_profile":{"type":"object","properties":{"id":{"type":"string","minLength":1},"organization_id":{"type":"string","minLength":1},"connection_id":{"type":"string","minLength":1},"employee_id":{"type":"string","minLength":1},"external_id":{"type":"string","minLength":1},"employee_name":{"type":"string","nullable":true},"employee_email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"group_memberships_synced_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","organization_id","connection_id","employee_id","external_id","created_at","updated_at"]}},"required":["employee_profile"]}}}},"responses":{"200":{"description":"Employee profile synced","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"created":{"type":"boolean"}},"required":["id","created"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Sync failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/credit_usage/evaluations":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"credit_usage_event":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1},"credits":{"type":"number","minimum":0,"exclusiveMinimum":true},"event_name":{"type":"string","minLength":1,"default":"qa_evaluation"},"charged_at":{"type":"string","format":"date-time"},"idempotency_key":{"type":"string","minLength":1},"grant_customer_id":{"type":"string","nullable":true,"minLength":1},"grant_usage_id":{"type":"string","nullable":true,"minLength":1},"qa_agent_evaluation_id":{"type":"string","nullable":true,"minLength":1},"conversation_id":{"type":"string","nullable":true,"minLength":1}},"required":["organization_id","credits","charged_at","idempotency_key"]}},"required":["credit_usage_event"]}}}},"responses":{"200":{"description":"QA evaluation credit usage recorded (or already present)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"recorded":{"type":"boolean"}},"required":["recorded"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Failed to record credit usage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{workItemId}/evaluation_contests":{"get":{"summary":"List evaluation contests raised against a work item","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"},{"schema":{"type":"string","description":"JSON-encoded evaluation contest filters"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Evaluation contests for the work item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"contested_evaluation_score":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_review_status":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"work_item_review_status":{"type":"string","nullable":true},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"employee":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","avatar_url"]},"scorecard_criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contest_score":{"type":"boolean","nullable":true},"contest_feedback":{"type":"boolean","nullable":true},"comment":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluation_scorecard_criterion_result":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"},"justification_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}}},"required":["id","label","type","value","justification_options"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]}},"required":["id","result","summary","check_description","scorecard_criterion_check_id","selected_justification_option"]}},"created_at":{"type":"string"},"updated_at":{"type":"string","nullable":true}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at"]}}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at","children"]}}},"required":["id","reason","score","max_score","scorecard_criterion_id","scorecard_criterion_description","scorecard_criterion_scoring_type","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","check_results","created_at","updated_at","children"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","contest_score","contest_feedback","comment","files","qa_agent_evaluation_scorecard_criterion_result","created_at","updated_at"]}},"feedback":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"submitted_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"evaluation_contest_criterion_feedbacks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contest_accepted":{"type":"boolean"},"notes":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"qa_agent_evaluation_scorecard_criterion_result":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","contest_accepted","notes","score","files","selected_score_option","qa_agent_evaluation_scorecard_criterion_result","created_at","updated_at"]}}},"required":["id","submitted_at","created_at","updated_at","submitted_by","evaluation_contest_criterion_feedbacks"]}},"required":["id","status","outcome","display_outcome","contest_level","contested_evaluation_score","created_at","updated_at","conversation_id","conversation_external_id","conversation_summary","conversation_review_status","work_item_id","work_item_external_id","work_item_summary","work_item_review_status","conversation_assignee","employee","scorecard_criterion_results","feedback"]}}},"required":["data"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"summary":"Contest a work item evaluation","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_contest":{"type":"object","properties":{"qa_agent_evaluation_id":{"type":"string"},"scorecard_criterion_results":{"type":"array","items":{"type":"object","properties":{"qa_agent_evaluation_scorecard_criterion_result_id":{"type":"string"},"contest_score":{"type":"boolean"},"contest_feedback":{"type":"boolean"},"comment":{"type":"string"},"file_signed_ids":{"type":"array","items":{"type":"string"}}},"required":["qa_agent_evaluation_scorecard_criterion_result_id","contest_score","contest_feedback","comment"]}}},"required":["qa_agent_evaluation_id","scorecard_criterion_results"]}},"required":["evaluation_contest"]}}}},"responses":{"201":{"description":"Evaluation contest created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{workItemId}/evaluation_contests/{contestId}/feedback":{"post":{"summary":"Resolve a work item evaluation contest","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"contestId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"object","properties":{"criterion_results":{"type":"object","additionalProperties":{"type":"object","properties":{"contestAccepted":{"type":"boolean"},"newScore":{"type":"number"},"selectedScoreOptionId":{"type":"string"},"selectedJustificationOptionId":{"type":"string"},"feedback":{"type":"string"},"file_signed_ids":{"type":"array","items":{"type":"string"}}}}}}}},"required":["feedback"]}}}},"responses":{"201":{"description":"Contest feedback recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/evaluation_contests/{evaluation_contest_id}/evaluation_contest_feedbacks":{"post":{"summary":"Resolve a conversation evaluation contest","description":"Records reviewer feedback on a contest, creates the replacement human evaluation with accepted rescoring, marks the contest resolved and refreshes the conversation's QA scores.","tags":["Evaluation contests"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"evaluation_contest_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feedback":{"type":"object","properties":{"criterion_results":{"type":"object","additionalProperties":{"type":"object","properties":{"contestAccepted":{"type":"boolean"},"newScore":{"type":"number"},"selectedScoreOptionId":{"type":"string"},"selectedJustificationOptionId":{"type":"string"},"feedback":{"type":"string"},"file_signed_ids":{"type":"array","items":{"type":"string"}}}}}}}},"required":["feedback"]}}}},"responses":{"200":{"description":"Contest feedback recorded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"submitted_at":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"evaluation_contest_criterion_feedbacks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"contest_accepted":{"type":"boolean"},"notes":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"qa_agent_evaluation_scorecard_criterion_result":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","contest_accepted","notes","score","files","selected_score_option","qa_agent_evaluation_scorecard_criterion_result","created_at","updated_at"]}}},"required":["id","submitted_at","created_at","updated_at","submitted_by","evaluation_contest_criterion_feedbacks"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/work_items/qa_score/recompute":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_item_id":{"type":"string","format":"uuid"},"organization_id":{"type":"string","minLength":1}},"required":["work_item_id","organization_id"]}}}},"responses":{"200":{"description":"Work item effective QA score recomputed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"recomputed":{"type":"boolean"}},"required":["recomputed"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/email-render":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"templateId":{"type":"string","enum":["weekly_digest"]},"params":{"type":"object","properties":{"markdown":{"type":"string"}},"required":["markdown"]}},"required":["templateId","params"]},{"type":"object","properties":{"templateId":{"type":"string","enum":["high_risk_notification"]},"params":{"type":"object","properties":{"organizationName":{"type":"string"},"customerComplaint":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"priority":{"type":"string"},"categories":{"type":"array","items":{"type":"string"}},"appUrl":{"type":"string"},"handlingAgent":{"type":"string"}},"required":["title","summary","priority","categories","appUrl"]}},"required":["organizationName","customerComplaint"]}},"required":["templateId","params"]},{"type":"object","properties":{"templateId":{"type":"string","enum":["poor_service_quality"]},"params":{"type":"object","properties":{"organizationName":{"type":"string"},"ticket":{"type":"object","properties":{"title":{"type":"string"},"summary":{"type":"string"},"appUrl":{"type":"string"},"source":{"type":"string"},"handlingAgent":{"type":"string"},"ticketId":{"type":"string"},"ticketUrl":{"type":"string"}},"required":["title","summary","appUrl","source","ticketId","ticketUrl"]}},"required":["organizationName","ticket"]}},"required":["templateId","params"]},{"type":"object","properties":{"templateId":{"type":"string","enum":["performance_report"]},"params":{"type":"object","properties":{"employeeName":{"type":"string"},"reportType":{"type":"string"},"startDate":{"type":"string"},"endDate":{"type":"string"},"reportUrl":{"type":"string"},"metrics":{"type":"object","properties":{"instancesReviewed":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":"string"}},"required":["title","value"]},"averageQaScore":{"type":"object","properties":{"title":{"type":"string"},"value":{"type":"string"}},"required":["title","value"]}},"required":["instancesReviewed","averageQaScore"]}},"required":["employeeName","reportType","startDate","endDate","reportUrl","metrics"]}},"required":["templateId","params"]}]}}}},"responses":{"200":{"description":"Rendered email HTML","content":{"text/html":{"schema":{"type":"string"}}}},"400":{"description":"Invalid email payload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/agents/export":{"get":{"responses":{"200":{"description":"Existing agents CSV export","content":{"text/csv":{"schema":{"type":"string"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/import_preview":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"200":{"description":"Import preview","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"preview":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}},"updated":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"changes":{"type":"array","items":{"type":"string"}}},"required":["email","changes"]}}},"required":["added","removed","updated"]}},"required":["success","preview"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Import preview failed validation","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]}}},"required":["success","errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/import":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}},"application/json":{"schema":{"type":"object","properties":{"employees":{"type":"object","properties":{"emails":{"type":"array","items":{"type":"string"}},"invite_to_rulebase":{"anyOf":[{"type":"boolean"},{"type":"string"},{"nullable":true}]},"actor_type":{"type":"string","nullable":true,"enum":["human","bot"]}},"required":["emails"]}},"required":["employees"]}}}},"responses":{"200":{"description":"Import succeeded","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"employees_count":{"type":"number"},"invitations_count":{"type":"number"}},"required":["success","employees_count","invitations_count"]}]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Import failed with row errors","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]}}},"required":["success","errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/import_sync":{"post":{"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"200":{"description":"Sync import succeeded","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"preview":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}},"updated":{"type":"array","items":{"type":"object","properties":{"email":{"type":"string"},"changes":{"type":"array","items":{"type":"string"}}},"required":["email","changes"]}}},"required":["added","removed","updated"]}},"required":["success","preview"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Sync import failed with row errors","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number"},"message":{"type":"string"}},"required":["row","message"]}}},"required":["success","errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_id","in":"query"}],"responses":{"200":{"description":"Agents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"},"previous":{"type":"string","nullable":true}},"required":["next","limit","total","previous"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Partner not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"min_qa_score","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"max_qa_score","in":"query"}],"responses":{"200":{"description":"Agent QA statistics","content":{"application/json":{"schema":{"type":"object","properties":{"average_qa_score_and_evaluations_count_by_agent":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"group_name":{"type":"string","nullable":true},"evaluations_count":{"type":"number"},"average_qa_score":{"type":"number","nullable":true}},"required":["agent_id","agent_name","group_name","evaluations_count","average_qa_score"]}},"top_performer":{"type":"object","nullable":true,"properties":{"agent_id":{"type":"string"},"agent_name":{"type":"string","nullable":true},"group_name":{"type":"string","nullable":true},"evaluations_count":{"type":"number"},"average_qa_score":{"type":"number","nullable":true},"adjusted_score":{"type":"number"}},"required":["agent_id","agent_name","group_name","evaluations_count","average_qa_score","adjusted_score"]},"average_agent_qa_score":{"type":"number","nullable":true},"needs_improvement_agents_count":{"type":"number"}},"required":["average_qa_score_and_evaluations_count_by_agent","top_performer","average_agent_qa_score","needs_improvement_agents_count"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]},"group_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"required":["id","created_at","updated_at","group"]}},"team":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},"manager":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"employee_field_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","employee_field_id","created_at","updated_at"]}}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type","group_memberships","team","manager","field_values"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"employee":{"type":"object","properties":{"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"group_id":{"type":"string","nullable":true},"team_id":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"anyOf":[{"type":"boolean"},{"type":"string"},{"nullable":true}]},"actor_type":{"type":"string","nullable":true,"enum":["human","bot"]},"partner_id":{"type":"string","nullable":true},"employment_started_on":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"field_values":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"additionalProperties":false}},"required":["employee"]}}}},"responses":{"200":{"description":"Updated agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]},"group_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"required":["id","created_at","updated_at","group"]}},"team":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},"manager":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"employee_field_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","employee_field_id","created_at","updated_at"]}}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type","group_memberships","team","manager","field_values"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/me":{"get":{"responses":{"200":{"description":"The authenticated account","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"account":{"type":"object","properties":{"full_name":{"type":"string"}},"required":["full_name"]}},"required":["account"]}}}},"responses":{"200":{"description":"The updated account","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/permissions":{"get":{"responses":{"200":{"description":"Assignable permissions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/roles":{"get":{"responses":{"200":{"description":"Roles visible to the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"permission_ids":{"type":"array","nullable":true,"items":{"type":"string"}}}}},"required":["role"]}}}},"responses":{"201":{"description":"Role created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/roles/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A role","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Role not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"permission_ids":{"type":"array","nullable":true,"items":{"type":"string"}}}}},"required":["role"]}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Role not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"permission_ids":{"type":"array","nullable":true,"items":{"type":"string"}}}}},"required":["role"]}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Role not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Role deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Role not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Role still has members","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/memberships":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Members of the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"},"previous":{"type":"string","nullable":true}},"required":["next","limit","total","previous"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/memberships/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"role_id":{"type":"string"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string"},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"]}}},"additionalProperties":false}},"required":["membership"]}}}},"responses":{"200":{"description":"Updated membership","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"membership":{"type":"object","properties":{"role_id":{"type":"string"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string"},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"]}}},"additionalProperties":false}},"required":["membership"]}}}},"responses":{"200":{"description":"Updated membership","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"job_title":{"type":"string","nullable":true},"active_evaluation_batches_count":{"type":"integer"},"assigned_conversations_count":{"type":"integer"},"scope_type":{"type":"string","nullable":true},"full_workspace_access":{"type":"boolean","nullable":true},"status":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"employee":{"type":"object","nullable":true,"properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluable":{"type":"boolean"},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"qa_summary":{"type":"string","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true},"discarded_at":{"type":"string","nullable":true},"direct_reports_count":{"type":"integer"},"avatar_url":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"type":{"type":"string","enum":["human","bot"]}},"required":["employment_started_on","tenure_status","id","name","phone","employee_id","job_title","email","created_at","updated_at","evaluable","agent_role","qa_summary","latest_agent_performance_report_end_date","latest_agent_performance_report_id","discarded_at","direct_reports_count","avatar_url","qa_score","average_handling_time","average_qa_score_delta","team_id","team_name","manager_name","manager_id","bot_provider_id","rulebase_invitation_status","group","type"]},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope_type":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope_type","scope"]}}},"required":["id","job_title","active_evaluation_batches_count","assigned_conversations_count","scope_type","full_workspace_access","status","created_at","updated_at","role","employee","account","scopes"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Membership removed"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invitations":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Invitations for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"scope_type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope"]}}},"required":["id","email","status","scope_type","created_at","updated_at","role","scopes"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/accounts":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Accounts with a membership in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/accounts/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An account","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Account not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/groups":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Agent teams in the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/groups/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An agent team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/partners":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Partners in the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partner":{"type":"object","properties":{"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","nullable":true,"items":{"type":"string"}}},"additionalProperties":false}},"required":["partner"]}}}},"responses":{"201":{"description":"Partner","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/partners/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A partner","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partner":{"type":"object","properties":{"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","nullable":true,"items":{"type":"string"}}},"additionalProperties":false}},"required":["partner"]}}}},"responses":{"200":{"description":"Partner","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"partner":{"type":"object","properties":{"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","nullable":true,"items":{"type":"string"}}},"additionalProperties":false}},"required":["partner"]}}}},"responses":{"200":{"description":"Partner","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Partner deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/clients":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Customers in the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/clients/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A customer","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_attributes":{"nullable":true},"companies":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"customer_field_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_field":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"nullable":true},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","name","external_id","value_type","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","customer_field_id","created_at","updated_at","customer_field"]}}},"required":["id","name","email","phone","created_at","updated_at","companies","field_values"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/audit_events":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Audit log for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"actor_type":{"type":"string"},"source":{"type":"string","nullable":true},"metadata":{"nullable":true},"target_type":{"type":"string","nullable":true},"target_public_id":{"type":"string","nullable":true},"target_summary":{"nullable":true},"request_ip":{"type":"string","nullable":true},"user_agent":{"type":"string","nullable":true},"request_id":{"type":"string","nullable":true},"occurred_at":{"type":"string"},"created_at":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["membership_id","name","email"]}},"required":["id","action","actor_type","source","target_type","target_public_id","request_ip","user_agent","request_id","occurred_at","created_at","actor"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Malformed filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/company-fields":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"owned","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"value_type","in":"query"}],"responses":{"200":{"description":"List company field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true,"enum":["string","boolean","date","datetime","number","enum","reference"]},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true,"enum":["currency","percentage"]}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","description","display_format"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"company_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"201":{"description":"Create a company field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-fields":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"owned","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List conversation field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true,"enum":["string","boolean","date","datetime","number","enum","multi_enum"]},"kind":{"type":"string","enum":["internal","customer"]}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","kind"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"201":{"description":"Create a conversation field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/complaint-fields":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"owned","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List complaint field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true,"enum":["string","boolean","date","datetime","number","enum","multi_enum"]}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"complaint_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"201":{"description":"Create a complaint field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-fields":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"owned","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List customer field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true,"enum":["string","boolean","date","datetime","number","enum"]}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"201":{"description":"Create a customer field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employee-fields":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"owned","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List agent field definitions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true,"enum":["string","boolean","date","datetime","number","enum"]},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"201":{"description":"Create a employee field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/company-fields/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"company_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Update a company field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a company field definition"},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/complaint-fields/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"complaint_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Update a complaint field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a complaint field definition"},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-fields/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Update a conversation field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a conversation field definition"},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-fields/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"customer_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Update a customer field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a customer field definition"},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employee-fields/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_field":{"type":"object","properties":{"label":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"name":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"value_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"options":{"type":"object","nullable":true,"properties":{"type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"record_type":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"values":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}},"labels":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}},"description":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"display_format":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Update a employee field definition","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"value_type":{"type":"string","nullable":true},"organization_data_source":{"nullable":true},"description":{"type":"string","nullable":true},"display_format":{"type":"string","nullable":true},"kind":{"type":"string"}},"required":["id","label","name","external_id","options","organization_data_source_id","editable","created_at","updated_at","value_type","organization_data_source"]}},"required":["data"]}}}},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Delete a employee field definition"},"400":{"description":"Missing wrapper or validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"403":{"description":"Provider-synced fields are read-only","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tags":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List organization tags","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","normalized_name","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"tag":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["tag"]}}}},"responses":{"200":{"description":"Tag created or found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","normalized_name","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid tag name","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-filters":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List saved conversation filters","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["conversation_filter"]},"attributes":{"type":"object","properties":{"name":{"type":"string","nullable":true},"condition":{"type":"string"},"alerting_enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["name","condition","alerting_enabled","created_at","updated_at"]}},"required":["id","type","attributes"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation-filters/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A saved conversation filter","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["conversation_filter"]},"attributes":{"type":"object","properties":{"name":{"type":"string","nullable":true},"condition":{"type":"string"},"alerting_enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["name","condition","alerting_enabled","created_at","updated_at"]}},"required":["id","type","attributes"]}},"required":["data"]}}}},"404":{"description":"Conversation filter not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaint-categories":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"List customer complaint categories","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","reference","priority","organization_data_source_id","channel_types","keywords","created_by_membership","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_complaint_category":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string","enum":["email","chat","call"]}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"_destroy":{"type":"boolean"}}}}}}},"required":["customer_complaint_category"]}}}},"responses":{"201":{"description":"The created complaint category","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","reference","priority","organization_data_source_id","channel_types","keywords","created_by_membership","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Missing the scorecards:manage permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Complaint category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid complaint category attributes","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaint-categories/{categoryId}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"categoryId","in":"path"}],"responses":{"200":{"description":"A customer complaint category","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","reference","priority","organization_data_source_id","channel_types","keywords","created_by_membership","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Complaint category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"categoryId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_complaint_category":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string","enum":["email","chat","call"]}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"_destroy":{"type":"boolean"}}}}}}},"required":["customer_complaint_category"]}}}},"responses":{"200":{"description":"The updated complaint category","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]},"organization_data_source_id":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"keywords":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"}},"required":["id","text"]}},"created_by_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","reference","priority","organization_data_source_id","channel_types","keywords","created_by_membership","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Missing the scorecards:manage permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Complaint category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid complaint category attributes","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"categoryId","in":"path"}],"responses":{"204":{"description":"The complaint category was discarded"},"403":{"description":"Missing the scorecards:manage permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Complaint category not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid complaint category attributes","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{complaintId}/documents":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"}],"responses":{"200":{"description":"The complaint's documents, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","filename","content_type","byte_size","url","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Complaint or document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_complaint_document":{"type":"object","properties":{"title":{"type":"string","nullable":true},"file_signed_id":{"type":"string","nullable":true}}}},"required":["customer_complaint_document"]}}}},"responses":{"201":{"description":"The created document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"filename":{"type":"string","nullable":true},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","filename","content_type","byte_size","url","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Complaint or document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"The file is missing, unsupported, or too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{complaintId}/documents/{documentId}/file":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"A one-hour signed URL for the stored file","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"404":{"description":"Complaint or document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{complaintId}/documents/{documentId}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"The document was deleted"},"404":{"description":"Complaint or document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/export":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"The complaints CSV","content":{"text/csv":{"schema":{"type":"string"}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"fields","in":"query"}],"responses":{"202":{"description":"The export was queued for email delivery","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/export-preview":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"fields","in":"query"}],"responses":{"200":{"description":"The first rows of the export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"rows":{"type":"array","items":{"type":"array","items":{"type":"string","nullable":true}}}},"required":["headers","rows"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"List customer complaints","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"complaint_key":{"type":"string"},"complaint_number":{"type":"integer","minimum":0,"exclusiveMinimum":true},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"category_priority":{"type":"string","nullable":true,"enum":["low","medium","high"]},"priority_override_reason":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"notified_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"originating_conversation_id":{"type":"string","nullable":true},"ticket_id":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]}},"required":["id","name","description","reference","priority"]}},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","complaint_key","complaint_number","title","summary","status","priority","category_priority","priority_override_reason","created_at","updated_at","notified_at","originating_conversation_id","ticket_id","company_name","categories","client","organization_data_source"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"A customer complaint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"complaint_key":{"type":"string"},"complaint_number":{"type":"integer","minimum":0,"exclusiveMinimum":true},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"category_priority":{"type":"string","nullable":true,"enum":["low","medium","high"]},"priority_override_reason":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"notified_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"originating_conversation_id":{"type":"string","nullable":true},"ticket_id":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]}},"required":["id","name","description","reference","priority"]}},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"assignee_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]}},"assignee_roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"conversations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"ticket_status":{"type":"string"},"review_status":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","started_at","created_at","external_created_at","external_id","subject","channel_types","ticket_status","review_status","description"]}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"risk_level":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"author_name":{"type":"string","nullable":true}},"required":["id","event_type","risk_level","content","created_at","conversation_id","author_name"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"complaint_field":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","name","external_id","value_type","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","complaint_field"]}}},"required":["id","complaint_key","complaint_number","title","summary","status","priority","category_priority","priority_override_reason","created_at","updated_at","notified_at","originating_conversation_id","ticket_id","company_name","categories","client","organization_data_source","customers","assignee_accounts","assignee_roles","conversations","events","field_values"]},"meta":{"type":"object","properties":{"previous":{"type":"string","nullable":true},"next":{"type":"string","nullable":true}},"required":["previous","next"]}},"required":["data","meta"]}}}},"404":{"description":"Complaint not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_complaint":{"type":"object","properties":{"status":{"type":"string","enum":["open","under_investigation","on_hold","provisional_credit_issued","resolved"]},"priority":{"type":"string","enum":["low","medium","high"]},"assignee_account_ids":{"type":"array","items":{"type":"string"}},"assignee_role_ids":{"type":"array","items":{"type":"string"}}}}},"required":["customer_complaint"]}}}},"responses":{"200":{"description":"The updated complaint","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"complaint_key":{"type":"string"},"complaint_number":{"type":"integer","minimum":0,"exclusiveMinimum":true},"title":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]},"category_priority":{"type":"string","nullable":true,"enum":["low","medium","high"]},"priority_override_reason":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"notified_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"originating_conversation_id":{"type":"string","nullable":true},"ticket_id":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"reference":{"type":"string","nullable":true},"priority":{"type":"string","enum":["low","medium","high"]}},"required":["id","name","description","reference","priority"]}},"client":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","complaint_key","complaint_number","title","summary","status","priority","category_priority","priority_override_reason","created_at","updated_at","notified_at","originating_conversation_id","ticket_id","company_name","categories","client","organization_data_source"]}},"required":["data"]}}}},"404":{"description":"Complaint not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid complaint attributes","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{complaintId}/customer-complaint-events":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"customer_complaint_event":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]}},"required":["customer_complaint_event"]}}}},"responses":{"201":{"description":"The created comment event","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"event_type":{"type":"string"},"risk_level":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"author_name":{"type":"string","nullable":true}},"required":["id","event_type","risk_level","content","created_at","conversation_id","author_name"]}},"required":["data"]}}}},"404":{"description":"Complaint not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid event attributes","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaints/{complaintId}/field_values/{fieldId}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"complaintId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fieldId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"type":"string"}},{"nullable":true},{"nullable":true}]}}}}}},"responses":{"200":{"description":"Updated complaint field value, or null when cleared","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"complaint_field":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"name":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"properties":{}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","name","external_id","value_type","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","complaint_field"]}},"required":["data"]}}}},"400":{"description":"Invalid field value","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Field is read-only","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Complaint or field not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-issues":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List customer issues","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["product","service"]}},"required":["id","name","description","type"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"type":{"type":"string","enum":["product","service"],"default":"service"}},"required":["name","description"]}}}},"responses":{"201":{"description":"Customer issue created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["product","service"]}},"required":["id","name","description","type"]}},"required":["data"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-issues/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Customer issue","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["product","service"]}},"required":["id","name","description","type"]}},"required":["data"]}}}},"404":{"description":"Customer issue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","minLength":1},"type":{"type":"string","enum":["product","service"],"default":"service"}},"required":["name","description"]}}}},"responses":{"200":{"description":"Customer issue updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["product","service"]}},"required":["id","name","description","type"]}},"required":["data"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Customer issue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Customer issue deleted"},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Customer issue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/tags/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Tag and its applications deleted"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/tags":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_tag":{"type":"object","properties":{"tag_id":{"type":"string"},"summary":{"type":"string","nullable":true}},"required":["tag_id"]}},"required":["conversation_tag"]}}}},"responses":{"201":{"description":"Tag applied","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"summary":{"type":"string","nullable":true}},"required":["id","name","normalized_name","created_at","updated_at","summary"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/tags/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Tag application removed (also when already absent)"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/sections":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"List knowledge base sections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/sections/{sectionId}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sectionId","in":"path"}],"responses":{"200":{"description":"A knowledge base section","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Knowledge base section not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/sources":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List knowledge base sources","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["zendesk","notion","url","confluence","scribe","intercom","google_drive"]},"url":{"type":"string","nullable":true},"sync_status":{"type":"string","enum":["pending","in_progress","completed","failed"]},"last_synced_at":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","type","url","sync_status","last_synced_at","knowledge_base_documents_count","created_at","updated_at","organization_data_source"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createKnowledgeLibrarySource","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_base_source":{"type":"object","properties":{"type":{"type":"string","enum":["zendesk","notion","url","confluence","scribe","intercom","google_drive"]},"url":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true}},"required":["type"]}},"required":["knowledge_base_source"]}}}},"responses":{"201":{"description":"Source","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["zendesk","notion","url","confluence","scribe","intercom","google_drive"]},"url":{"type":"string","nullable":true},"sync_status":{"type":"string","enum":["pending","in_progress","completed","failed"]},"last_synced_at":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","type","url","sync_status","last_synced_at","knowledge_base_documents_count","created_at","updated_at","organization_data_source"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"List knowledge base documents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"createKnowledgeLibraryDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_base_document":{"type":"object","properties":{"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"title":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"knowledge_base_section_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}}}}},"required":["knowledge_base_document"]}}}},"responses":{"201":{"description":"Document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","content","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents/{documentId}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"A knowledge base document, including its content","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","content","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]},"meta":{"type":"object","properties":{"previous_id":{"type":"string","nullable":true},"next_id":{"type":"string","nullable":true}},"required":["previous_id","next_id"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateKnowledgeLibraryDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_base_document":{"type":"object","properties":{"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"title":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"knowledge_base_section_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}}}}},"required":["knowledge_base_document"]}}}},"responses":{"200":{"description":"Document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","content","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteKnowledgeLibraryDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Discarded"},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/citations/{citationId}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"citationId","in":"path"}],"responses":{"200":{"description":"A knowledge base check citation quote selector","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"knowledge_base_document_id":{"type":"string"},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["knowledge_base_document_id","heading_path","quote_exact"]}},"required":["data"]}}}},"404":{"description":"Citation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents/import":{"post":{"operationId":"importKnowledgeLibraryDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Document file (PDF, Word, Excel, PowerPoint, CSV, text, or image; max 40 MB)","format":"binary"}}}}}},"responses":{"201":{"description":"Document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","content","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents/import-pdf":{"post":{"operationId":"importKnowledgeLibraryPdfDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","description":"Deprecated alias of /import. Document file (max 40 MB)","format":"binary"}}}}}},"responses":{"201":{"description":"Document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"document_kind":{"type":"string","enum":["knowledge","memory"]},"id":{"type":"string"},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"source_type":{"type":"string","enum":["url","notion","zendesk","confluence","scribe","manual","file","intercom","google_drive"]},"zendesk_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"knowledge_base_section":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","knowledge_base_documents_count","created_at","updated_at"]}},"required":["document_kind","id","title","url","notion_page_id","content","tags","source_type","zendesk_locale","created_at","updated_at","knowledge_base_section"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/documents/{documentId}/sync":{"post":{"operationId":"syncKnowledgeLibraryDocument","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Sync enqueued"},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/sources/{sourceId}":{"patch":{"operationId":"updateKnowledgeLibrarySource","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sourceId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"knowledge_base_source":{"type":"object","properties":{"type":{"type":"string","enum":["zendesk","notion","url","confluence","scribe","intercom","google_drive"]},"url":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true}}}},"required":["knowledge_base_source"]}}}},"responses":{"200":{"description":"Source","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["zendesk","notion","url","confluence","scribe","intercom","google_drive"]},"url":{"type":"string","nullable":true},"sync_status":{"type":"string","enum":["pending","in_progress","completed","failed"]},"last_synced_at":{"type":"string","nullable":true},"knowledge_base_documents_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["id","type","url","sync_status","last_synced_at","knowledge_base_documents_count","created_at","updated_at","organization_data_source"]}},"required":["data"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteKnowledgeLibrarySource","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sourceId","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-library/sources/{sourceId}/sync":{"post":{"operationId":"syncKnowledgeLibrarySource","tags":["Knowledge Library"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"sourceId","in":"path"}],"responses":{"204":{"description":"Sync enqueued"},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing knowledge_base:manage","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/{id}/team":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"team_id":{"type":"string","nullable":true},"team_history_transfer_from":{"type":"string","description":"\"all\" to move the agent's whole history to the new team, or a YYYY-MM-DD date to move it from that day onwards. Omit to leave history with the previous team."}},"required":["team_id"]}}}},"responses":{"200":{"description":"Team changed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"team_id":{"type":"string","nullable":true},"team_history_transfer_from":{"type":"string","nullable":true}},"required":["id","team_id","team_history_transfer_from"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent or team not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid team history transfer value","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/{id}/merge":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"merge":{"type":"object","properties":{"target_employee_id":{"type":"string"},"destroy_source":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]}},"required":["target_employee_id"]}},"required":["merge"]}}}},"responses":{"201":{"description":"Merge queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"sourceEmployeeId":{"type":"string"},"targetEmployeeId":{"type":"string"},"destroySource":{"type":"boolean"},"error":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","status","sourceEmployeeId","targetEmployeeId","destroySource","error","startedAt","finishedAt","createdAt"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/merges/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Merge run status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"sourceEmployeeId":{"type":"string"},"targetEmployeeId":{"type":"string"},"destroySource":{"type":"boolean"},"error":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true},"finishedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","status","sourceEmployeeId","targetEmployeeId","destroySource","error","startedAt","finishedAt","createdAt"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Merge run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employees/{id}/invite":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Invited agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/employee-tenure-settings":{"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"agent_tenure_threshold_days":{"type":"integer","nullable":true,"minimum":1,"maximum":3650}},"required":["agent_tenure_threshold_days"]}}}},"responses":{"200":{"description":"Updated agent tenure settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agent_tenure_threshold_days":{"type":"integer","nullable":true,"minimum":1,"maximum":3650}},"required":["agent_tenure_threshold_days"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/teams":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"name":{"type":"string"},"partner_id":{"type":"string","nullable":true},"zendesk_brand_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"required":["team"]}}}},"responses":{"201":{"description":"Team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids","partner","team_lead_membership","team_lead_memberships"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"zendesk_brand_id","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_lead_membership_id","in":"query"},{"schema":{"type":"string","enum":["name","created_at"],"default":"name"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"asc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List teams","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_id":{"type":"string","nullable":true},"zendesk_brand_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_id","zendesk_brand_id","team_lead_membership_id","team_lead_membership_ids","employees_count","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid team filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/teams/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"name":{"type":"string"},"partner_id":{"type":"string","nullable":true},"zendesk_brand_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"required":["team"]}}}},"responses":{"200":{"description":"Team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids","partner","team_lead_membership","team_lead_memberships"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"team":{"type":"object","properties":{"name":{"type":"string"},"partner_id":{"type":"string","nullable":true},"zendesk_brand_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"additionalProperties":false}},"required":["team"]}}}},"responses":{"200":{"description":"Team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids","partner","team_lead_membership","team_lead_memberships"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Team discarded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","email","full_name","created_at","updated_at"]}},"required":["id","account"]}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids","partner","team_lead_membership","team_lead_memberships"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invitations/{id}/revoke":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revoked invitation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"scope_type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope"]}}},"required":["id","email","status","scope_type","created_at","updated_at","role","scopes"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/invitations/import":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"invitations":{"type":"object","properties":{"role_id":{"type":"string"},"scope_type":{"type":"string","nullable":true},"emails":{"type":"array","items":{"type":"string"}},"scopes":{"type":"array","items":{"type":"object","properties":{"scope_type":{"type":"string"},"scope_id":{"type":"string"}},"required":["scope_type","scope_id"]}}},"required":["role_id","emails"],"additionalProperties":false}},"required":["invitations"]}}}},"responses":{"201":{"description":"Created invitations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"scope_type":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]},"scopes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scope":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]},{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"zendesk_brand_id":{"type":"string","nullable":true},"partner_id":{"type":"string","nullable":true},"team_lead_membership_id":{"type":"string","nullable":true},"team_lead_membership_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","employees_count","created_at","updated_at","zendesk_brand_id","partner_id","team_lead_membership_id","team_lead_membership_ids"]},{"nullable":true}]}},"required":["id","scope"]}}},"required":["id","email","status","scope_type","created_at","updated_at","role","scopes"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Unprocessable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/dashboards":{"get":{"responses":{"200":{"description":"Dashboards shown on Home","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"dashboards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"picked":{"type":"boolean"}},"required":["dashboards","picked"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_ids":{"type":"array","items":{"type":"string"},"maxItems":2}},"required":["dashboard_ids"]}}}},"responses":{"200":{"description":"Dashboards shown on Home","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"dashboards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"picked":{"type":"boolean"}},"required":["dashboards","picked"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{id}/views":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"View recorded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/cards":{"get":{"responses":{"200":{"description":"Cards shown on Home: data points and dashboards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"data_points":{"type":"array","items":{"type":"string","enum":["assigned","coverage"]}},"dashboards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"picked":{"type":"boolean"}},"required":["data_points","dashboards","picked"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"data_points":{"type":"array","items":{"type":"string","enum":["assigned","coverage"]}},"dashboard_ids":{"type":"array","items":{"type":"string"},"maxItems":2}},"required":["data_points","dashboard_ids"]}}}},"responses":{"200":{"description":"Cards shown on Home: data points and dashboards","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"data_points":{"type":"array","items":{"type":"string","enum":["assigned","coverage"]}},"dashboards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"picked":{"type":"boolean"}},"required":["data_points","dashboards","picked"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards":{"get":{"responses":{"200":{"description":"Dashboards found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string","minLength":1},"card_header_color":{"type":"string","minLength":1},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"},"default":[]},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["type"]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"dashboard_chart_id":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"layout":{"type":"object","nullable":true,"properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"_destroy":{"type":"boolean"}}}}},"required":["name"]}},"required":["dashboard"]}}}},"responses":{"201":{"description":"Dashboard created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_groups":{"get":{"responses":{"200":{"description":"Dashboard groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","position","created_at","updated_at"]}}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_group":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"integer"}},"required":["name"]}},"required":["dashboard_group"]}}}},"responses":{"201":{"description":"Dashboard group created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","position","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_groups/{id}":{"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_group":{"type":"object","properties":{"name":{"type":"string"},"position":{"type":"integer"}}}},"required":["dashboard_group"]}}}},"responses":{"200":{"description":"Dashboard group updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","position","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard group deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_preferences":{"get":{"responses":{"200":{"description":"Dashboard preferences found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"dashboard_id":{"type":"string"},"pinned":{"type":"boolean"},"homepage":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","dashboard_id","pinned","homepage","created_at","updated_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{dashboard_id}/dashboard_preference":{"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_preference":{"type":"object","properties":{"pinned":{"type":"boolean"},"homepage":{"type":"boolean"}}}},"required":["dashboard_preference"]}}}},"responses":{"200":{"description":"Dashboard preference updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"dashboard_id":{"type":"string"},"pinned":{"type":"boolean"},"homepage":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","dashboard_id","pinned","homepage","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/from_template":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"template":{"type":"string","enum":["average_qa_score","average_handling_time","average_sentiment_score","evaluations","qa_analysts","sla","customer_issues","calibration_progress","coaching"]},"name":{"type":"string"},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true}},"required":["template"]}},"required":["dashboard"]}}}},"responses":{"201":{"description":"Dashboard created from template","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string","minLength":1},"card_header_color":{"type":"string","minLength":1},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"filter_rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"},"default":[]},"config":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["type"]}}}}},"required":["dashboard"]}}}},"responses":{"200":{"description":"Dashboard updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{id}/duplicate":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"name":{"type":"string","nullable":true}}}}}}}},"responses":{"201":{"description":"Dashboard duplicated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{id}/reorder":{"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard":{"type":"object","properties":{"sections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer"}},"required":["id","position"]}},"widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer"},"dashboard_section_id":{"type":"string","nullable":true},"layout":{"type":"object","nullable":true,"properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false}},"required":["id","position"]}}}}},"required":["dashboard"]}}}},"responses":{"200":{"description":"Dashboard reordered","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["data"]}}}},"400":{"description":"Invalid reorder","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{dashboard_id}/dashboard_sections":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"responses":{"200":{"description":"Dashboard sections found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}}},"required":["id","name","position","created_at","updated_at","dashboard_widgets"]}}},"required":["data"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_section":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["dashboard_section"]}}}},"responses":{"201":{"description":"Dashboard section created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}}},"required":["id","name","position","created_at","updated_at","dashboard_widgets"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_sections/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_section":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["dashboard_section"]}}}},"responses":{"200":{"description":"Dashboard section updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_widgets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}}},"required":["id","name","position","created_at","updated_at","dashboard_widgets"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard section not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard section deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard section not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Cannot delete section","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_charts":{"get":{"responses":{"200":{"description":"Dashboard charts found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_chart":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}}}}},"required":["dashboard_chart"]}}}},"responses":{"201":{"description":"Dashboard chart created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_charts/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard chart found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Dashboard chart not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_chart":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}}}}},"required":["dashboard_chart"]}}}},"responses":{"200":{"description":"Dashboard chart updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard chart not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_charts/suggest-name":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_chart":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"labels":{"type":"object","properties":{"source":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"metric":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"displayType":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"displayUnit":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"dateGrouping":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"comparisonPeriod":{"type":"object","nullable":true,"properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"filters":{"type":"array","nullable":true,"items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}}}}},"required":["dashboard_chart"]}}}},"responses":{"200":{"description":"Suggested name for a dashboard chart","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{dashboard_id}/dashboard_widgets":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"responses":{"200":{"description":"Dashboard widgets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}}},"required":["data"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_widget":{"type":"object","properties":{"id":{"type":"string"},"dashboard_chart_id":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"layout":{"type":"object","nullable":true,"properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"_destroy":{"type":"boolean"}}}},"required":["dashboard_widget"]}}}},"responses":{"201":{"description":"Dashboard widget created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]},"dashboard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/preview":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_widget":{"type":"object","properties":{"id":{"type":"string"},"dashboard_chart_id":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"layout":{"type":"object","nullable":true,"properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"_destroy":{"type":"boolean"}}}},"required":["dashboard_widget"]}}}},"responses":{"200":{"description":"Preview statistics returned","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true},"meta":{"type":"object","properties":{"resolved_query":{"nullable":true},"comparison":{"type":"object","properties":{"data":{"nullable":true}}}}}}}}}}}}},"/dashboard_widgets/{id}/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard widget statistics found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true},"meta":{"type":"object","properties":{"resolved_query":{"nullable":true},"resolved_query_token":{"type":"string"},"comparison":{"type":"object","properties":{"data":{"nullable":true}}}}}}}}}}}}},"/dashboard_widgets/{id}/drilldowns/agents_evaluated":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Agents evaluated drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"agent_name":{"type":"string"},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"ai_evaluations_count":{"type":"integer"},"manual_evaluations_count":{"type":"integer"}},"required":["agent_id","agent_name","team_id","team_name","ai_evaluations_count","manual_evaluations_count"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/agents_evaluated_ticket_counts":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Agents evaluated ticket counts found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"tickets_resolved_count":{"type":"integer"},"not_evaluated_count":{"type":"integer"}},"required":["agent_id","tickets_resolved_count","not_evaluated_count"]}}},"required":["data"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/calibration_check_alignment":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluation_batch_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"}],"responses":{"200":{"description":"Calibration check alignment drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"criterion_id":{"type":"string"},"criterion_name":{"type":"string"},"agreement_pct":{"type":"number"},"aligned_count":{"type":"integer"},"misaligned_count":{"type":"integer"},"compared_count":{"type":"integer"}},"required":["criterion_id","criterion_name","agreement_pct","aligned_count","misaligned_count","compared_count"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]},"session_names":{"type":"array","items":{"type":"string"}}},"required":["page","session_names"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/calibration_evaluations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"evaluator_id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"evaluation_batch_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"}],"responses":{"200":{"description":"Calibration evaluations drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"created_at":{"type":"string"},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url","type"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true}},"required":["id","full_name"]}},"required":["id","source","score_level","overall_score","created_at","qa_evaluation_id","conversation_id","conversation_external_id","conversation_summary","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/evaluations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"qa_level","in":"query"},{"schema":{"type":"string"},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"source_channels","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluator_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_by_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"work_item_type","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"has_auto_fail","in":"query"},{"schema":{"type":"string"},"required":false,"name":"read_status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_field_filters","in":"query"}],"responses":{"200":{"description":"Evaluations drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"created_at":{"type":"string"},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url","type"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true}},"required":["id","full_name"]}},"required":["id","source","score_level","overall_score","created_at","qa_evaluation_id","conversation_id","conversation_external_id","conversation_summary","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/closed_conversations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"customer_issue_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tag_id","in":"query"}],"responses":{"200":{"description":"Closed conversations drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"closed_at":{"type":"string"},"closes_count":{"type":"number"},"closed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url","type"]}},"required":["id","external_id","summary","source_channel","closed_at","closes_count","closed_by"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/conversation_assignments":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolver_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_by_type","in":"query"}],"responses":{"200":{"description":"Conversation assignments drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"created_by_type":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"required":["id","status","created_at","resolved_at","ended_at","created_by_type","conversation_id","conversation_external_id","conversation_summary","source_channel","assignee","resolver"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/work_items":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"work_item_type","in":"query"}],"responses":{"200":{"description":"Work items drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"short_description":{"type":"string","nullable":true},"created_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"subject_agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"required":["id","external_id","type","status","short_description","created_at","completed_at","subject_agent"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/drilldowns/coaching_sessions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"coach_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"delivery_status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"priority","in":"query"},{"schema":{"type":"string"},"required":false,"name":"scorecard_criterion_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"validation_state","in":"query"}],"responses":{"200":{"description":"Coaching sessions drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"delivery_status":{"type":"string"},"priority":{"type":"string"},"coached_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]},"coach":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"required":["id","delivery_status","priority","coached_at","created_at","agent","coach"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}/agents_not_evaluated_reasons":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"agent_id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Agent not-evaluated reasons found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reasons":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"count":{"type":"number"}},"required":["label","count"]}}},"required":["reasons"]}},"required":["data"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard widget found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]},"dashboard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}},"required":["data"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_widget":{"type":"object","properties":{"id":{"type":"string"},"dashboard_chart_id":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","nullable":true,"enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string","nullable":true},"date_range_to":{"type":"string","nullable":true},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","nullable":true,"items":{"type":"string"}},"layout":{"type":"object","nullable":true,"properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","nullable":true,"properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"_destroy":{"type":"boolean"}}}},"required":["dashboard_widget"]}}}},"responses":{"200":{"description":"Dashboard widget updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"integer","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"dashboard_section_id":{"type":"string","nullable":true},"dashboard_chart_id":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"layout":{"type":"object","properties":{"lg":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"md":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"sm":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]},"xxs":{"type":"object","properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0},"w":{"type":"integer","minimum":1},"h":{"type":"integer","minimum":1}},"required":["x","y","w","h"]}},"additionalProperties":false},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"dashboard_chart":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true,"enum":["qa_agent_evaluation","criterion_result","check_result","complaint","dispute","sla_breach","sla_adherence","sla_adherence_weekly","evaluated_conversation","new_conversation","resolved_conversation","conversation_close_action","conversation","conversation_agent","conversation_assignment","evaluation_contest","conversation_tag","calibration","calibration_evaluator","imported_work_item","completed_work_item","coaching_session"]},"metric_aggregation":{"type":"string","nullable":true,"enum":["average","sum","count"]},"metric_field":{"type":"string","nullable":true,"enum":["overall_score","handling_time","agent_handling_time","resolution_time_seconds","qa_score","ai_manual_qa_score_match","sentiment_score","csat_score","auto_fail_rate","auto_fail_evaluation_rate","auto_fail_conversation_rate","evaluation_read_rate","unique_agents_evaluated","assigned_count","reviewed_count","transferred_count","scorecard_criterion_pass_rate","sla_adherence","sla_adherence_resolution","sla_adherence_response","ai_human_alignment","human_human_alignment","evaluator_score","coaching_validations","coaching_effectiveness"]},"display_type":{"type":"string","nullable":true,"enum":["line_chart","bar_chart","stacked_bar_chart","table_time_series","table","number","bar_chart_total","pie_chart_total","heatmap"]},"display_unit":{"type":"string","nullable":true,"enum":["none","duration_seconds","duration_ms","percent_0_100","percent_0_1","currency","score"]},"date_grouping":{"type":"string","enum":["day","week","month"]},"week_start_day":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"date_range_from":{"type":"string"},"date_range_to":{"type":"string"},"comparison_period":{"type":"string","nullable":true,"enum":["previous_period"]},"dimensions":{"type":"array","items":{"type":"string"}},"config":{"type":"object","properties":{"show_chart_values":{"type":"boolean"},"show_as_percent_of_total":{"type":"boolean"},"show_rate_within_group":{"type":"boolean"},"bar_stacking":{"type":"string","enum":["grouped","stacked","percent"]},"bar_orientation":{"type":"string","enum":["vertical","horizontal"]}},"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","config","created_at","updated_at"]},"dashboard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"visibility":{"type":"string","enum":["organization","invited"]},"card_emoji":{"type":"string"},"card_header_color":{"type":"string"},"card_header_pattern":{"type":"string","enum":["solid","noise","gradient","dots"]},"dashboard_group_id":{"type":"string","nullable":true},"dashboard_group_position":{"type":"integer","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"filter_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["channel","connection","date_range","employee","group","manager","partner","team","work_item_type","zendesk_brand"]},"value":{"type":"array","items":{"type":"string"}},"config":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","type","value","config","created_at","updated_at"]}},"accesses":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["id","name","visibility","card_emoji","card_header_color","card_header_pattern","dashboard_group_id","dashboard_group_position","created_at","updated_at","created_by","filter_rules","accesses"]}},"required":["id","position","name","description","dashboard_section_id","dashboard_chart_id","source","metric_aggregation","metric_field","display_type","display_unit","date_grouping","week_start_day","date_range_from","date_range_to","comparison_period","dimensions","layout","config","created_at","updated_at","dashboard_chart"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard widget deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboards/{dashboard_id}/dashboard_accesses":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"responses":{"200":{"description":"Dashboard accesses found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_access":{"type":"object","properties":{"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"}},"required":["grantee_type","grantee_id"]}},"required":["dashboard_access"]}}}},"responses":{"201":{"description":"Dashboard access created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"grantee_type":{"type":"string","enum":["membership"]},"grantee_id":{"type":"string"},"grantee_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","grantee_type","grantee_id","grantee_name","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard or grantee not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_accesses/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard access deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard access not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widget_type_groups":{"get":{"responses":{"200":{"description":"Dashboard widget type groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/dashboard_widget_type_groups/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard widget type group found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"types":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}}},"required":["id","name","created_at","updated_at","types"]}},"required":["data"]}}}},"404":{"description":"Dashboard widget type group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widget_type_groups/{dashboard_widget_type_group_id}/dashboard_widget_types":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_widget_type_group_id","in":"path"}],"responses":{"200":{"description":"Dashboard widget types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget type group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widget_types":{"get":{"responses":{"200":{"description":"Dashboard widget types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/dashboard_widget_types/{id}/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard widget type statistics found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true}}}}}},"404":{"description":"Dashboard widget type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widget_types/{id}/drilldowns/evaluations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"resolved_query_token","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"partner_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"qa_level","in":"query"},{"schema":{"type":"string"},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"source_channels","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluator_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"resolved_by_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"work_item_type","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"has_auto_fail","in":"query"},{"schema":{"type":"string"},"required":false,"name":"read_status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"conversation_field_filters","in":"query"}],"responses":{"200":{"description":"Evaluations drilldown found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"created_at":{"type":"string"},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url","type"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true}},"required":["id","full_name"]}},"required":["id","source","score_level","overall_score","created_at","qa_evaluation_id","conversation_id","conversation_external_id","conversation_summary","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"422":{"description":"Dashboard drilldown is not supported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/service_issues":{"get":{"responses":{"200":{"description":"Service issues statistics found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"nullable":true}}}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{id}/statistics":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"}],"responses":{"200":{"description":"Scorecard statistics found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"criteria_score_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterionScoreBreakdown"}},"criteria_adherence_breakdown":{"type":"array","items":{"$ref":"#/components/schemas/ScorecardCriterionAdherence"}}},"required":["criteria_score_breakdown","criteria_adherence_breakdown"]}},"required":["data"]}}}},"404":{"description":"Scorecard not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widget_types/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard widget type found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Dashboard widget type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_widgets/{dashboard_widget_id}/dashboard_alerts":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_widget_id","in":"path"}],"responses":{"200":{"description":"Dashboard alerts found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"type":"string"},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","threshold_type","threshold_value","baseline_period","window_period","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"dashboard_widget_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_alert":{"type":"object","properties":{"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"anyOf":[{"type":"string"},{"type":"number"}]},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]}}}},"required":["dashboard_alert"]}}}},"responses":{"201":{"description":"Dashboard alert created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"type":"string"},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","threshold_type","threshold_value","baseline_period","window_period","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard widget not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/dashboard_alerts/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Dashboard alert found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"type":"string"},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","threshold_type","threshold_value","baseline_period","window_period","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Dashboard alert not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"dashboard_alert":{"type":"object","properties":{"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"anyOf":[{"type":"string"},{"type":"number"}]},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]}}}},"required":["dashboard_alert"]}}}},"responses":{"200":{"description":"Dashboard alert updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"threshold_type":{"type":"string","enum":["percent_above_baseline","absolute_count"]},"threshold_value":{"type":"string"},"baseline_period":{"type":"string","nullable":true,"enum":["previous_week","thirty_day_avg"]},"window_period":{"type":"string","enum":["seven_days","thirty_days"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","threshold_type","threshold_value","baseline_period","window_period","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard alert not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Dashboard alert deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Dashboard alert not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/summary":{"get":{"responses":{"200":{"description":"Home summary cards for the current member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"assigned":{"type":"object","properties":{"total":{"type":"number"},"due":{"type":"number"}},"required":["total","due"]},"coverage":{"type":"object","nullable":true,"properties":{"evaluated":{"type":"number"},"resolved":{"type":"number"},"rate":{"type":"number","nullable":true},"start_date":{"type":"string"},"end_date":{"type":"string"}},"required":["evaluated","resolved","rate","start_date","end_date"]}},"required":["assigned","coverage"]}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/low-scores":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"date","in":"query"}],"responses":{"200":{"description":"Today's low-scoring evaluations by local hour, split by accessible team","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"date":{"type":"string"},"threshold":{"type":"number"},"total":{"type":"number"},"teams":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"total":{"type":"number"}},"required":["id","name","total"]}},"hours":{"type":"array","items":{"type":"object","properties":{"hour":{"type":"number"},"counts":{"type":"object","additionalProperties":{"type":"number"}}},"required":["hour","counts"]}}},"required":["date","threshold","total","teams","hours"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/coaching-signals":{"get":{"responses":{"200":{"description":"Agents whose QA score, auto-fails, or criterion failures worsened this week","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"agent_name":{"type":"string"},"team":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"reasons":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["qa_score_drop"]},"previous":{"type":"number"},"current":{"type":"number"}},"required":["type","previous","current"]},{"type":"object","properties":{"type":{"type":"string","enum":["auto_fail_rise"]},"previous":{"type":"number"},"current":{"type":"number"}},"required":["type","previous","current"]},{"type":"object","properties":{"type":{"type":"string","enum":["criterion_failure_rise"]},"criterion_name":{"type":"string"},"previous":{"type":"number"},"current":{"type":"number"}},"required":["type","criterion_name","previous","current"]}]}}},"required":["agent_id","agent_name","team","reasons"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/suggestions":{"get":{"responses":{"200":{"description":"Chat suggestions and chips for the Home composer, from the member's recent activity and live workload","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"prompt":{"type":"string"},"reason":{"type":"string"}},"required":["id","title","prompt","reason"]}},"chips":{"type":"array","items":{"type":"string","enum":["explain-drop","check-policy","dispute-reply","compare-teams","weekly-summary","prep-one-on-one","usage-report","audit-grader"]}}},"required":["data","chips"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/role-overview":{"get":{"responses":{"200":{"description":"Home: suggested tasks ranked by the member's recent activity, and each team's QA score this week vs last","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"role":{"type":"string","enum":["qa_analyst","team_lead","admin"]},"week_start":{"type":"string"},"focus":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["review","dispute","brief","coaching","criterion","sync","calibration","report"]},"title":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","completed"]},"href":{"type":"string","nullable":true},"prompt":{"type":"string","nullable":true},"flag":{"type":"object","nullable":true,"properties":{"label":{"type":"string"},"tone":{"type":"string","enum":["danger","warning","success","neutral"]}},"required":["label","tone"]},"team":{"type":"string"},"when":{"type":"string"},"detail_flag":{"type":"object","nullable":true,"properties":{"label":{"type":"string"},"tone":{"type":"string","enum":["danger","warning","success","neutral"]}},"required":["label","tone"]},"why":{"type":"string"},"points_label":{"type":"string"},"points":{"type":"array","items":{"type":"string"}},"list_label":{"type":"string"},"list":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"},"initials":{"type":"string","nullable":true},"tone":{"type":"string","nullable":true,"enum":["danger","warning","success","neutral"]}},"required":["label","value","initials","tone"]}}},"required":["id","kind","title","status","href","prompt","flag","team","when","detail_flag","why","points_label","points","list_label","list"]}},"performance":{"type":"array","items":{"type":"object","properties":{"team_id":{"type":"string"},"team_name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number","nullable":true},"evaluations":{"type":"number"}},"required":["team_id","team_name","score","change_points","evaluations"]}}},"required":["role","week_start","focus","performance"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/focus-tasks/{taskKey}/status":{"put":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":true,"name":"taskKey","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","completed"]}},"required":["status"]}}}},"responses":{"200":{"description":"Saves the member's status for a Focus today task this week","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"task_key":{"type":"string"},"week_start":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","completed"]}},"required":["task_key","week_start","status"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/qa-scores-week":{"get":{"responses":{"200":{"description":"The last seven days' evaluations by local day, passed vs failed, for accessible teams","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"threshold":{"type":"number"},"passed":{"type":"number"},"failed":{"type":"number"},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"passed":{"type":"number"},"failed":{"type":"number"},"failed_by_team":{"type":"array","items":{"type":"object","properties":{"team_name":{"type":"string"},"count":{"type":"number"}},"required":["team_name","count"]}}},"required":["date","passed","failed","failed_by_team"]}}},"required":["threshold","passed","failed","days"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/reviews":{"get":{"parameters":[{"schema":{"type":"string","enum":["today","week"],"default":"today"},"required":false,"name":"range","in":"query"}],"responses":{"200":{"description":"The member's open assigned reviews, grouped by due date","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"title":{"type":"string"},"team_name":{"type":"string","nullable":true},"due_at":{"type":"string"},"group":{"type":"string","enum":["overdue","due_today","upcoming"]},"href":{"type":"string"}},"required":["conversation_id","title","team_name","due_at","group","href"]}}},"required":["data"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/week-item-statuses":{"get":{"responses":{"200":{"description":"Saved statuses for this week's Home items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"task_key":{"type":"string"},"status":{"type":"string","enum":["open","in_progress","completed"]}},"required":["task_key","status"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/pass-rate/agents":{"get":{"responses":{"200":{"description":"Agents' pass rate over the last 7 days against the 7 before","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"agent_id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number","nullable":true},"evaluations":{"type":"number"}},"required":["agent_id","name","score","change_points","evaluations"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/pass-rate/trend":{"get":{"responses":{"200":{"description":"Accessible teams' QA score over the last 7 days, by day, against the 7 before","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"score":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"evaluations":{"type":"number"},"week":{"type":"object","properties":{"evaluations":{"type":"number"},"score":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"low_scores":{"type":"number"},"reviews":{"type":"number"}},"required":["evaluations","score","previous_score","low_scores","reviews"]},"days":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"score":{"type":"number","nullable":true},"evaluations":{"type":"number"}},"required":["date","score","evaluations"]}}},"required":["score","previous_score","evaluations","week","days"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/home/pass-rate/movers":{"get":{"responses":{"200":{"description":"Accessible teams trending down and up most over the last 7 days, with the agent driving each","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"down":{"type":"array","items":{"type":"object","properties":{"team_id":{"type":"string"},"team_name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number"},"direction":{"type":"string","enum":["down","up"]},"agent":{"type":"object","nullable":true,"properties":{"agent_id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number"}},"required":["agent_id","name","score","change_points"]},"agents_moving":{"type":"number"},"drivers":{"type":"array","items":{"type":"object","properties":{"criterion_id":{"type":"string"},"name":{"type":"string"},"change_points":{"type":"number"},"failed":{"type":"number"}},"required":["criterion_id","name","change_points","failed"]}}},"required":["team_id","team_name","score","change_points","direction","agent","agents_moving","drivers"]}},"up":{"type":"array","items":{"type":"object","properties":{"team_id":{"type":"string"},"team_name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number"},"direction":{"type":"string","enum":["down","up"]},"agent":{"type":"object","nullable":true,"properties":{"agent_id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number","nullable":true},"change_points":{"type":"number"}},"required":["agent_id","name","score","change_points"]},"agents_moving":{"type":"number"},"drivers":{"type":"array","items":{"type":"object","properties":{"criterion_id":{"type":"string"},"name":{"type":"string"},"change_points":{"type":"number"},"failed":{"type":"number"}},"required":["criterion_id","name","change_points","failed"]}}},"required":["team_id","team_name","score","change_points","direction","agent","agents_moving","drivers"]}}},"required":["down","up"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/skill-sections":{"get":{"responses":{"200":{"description":"List of skill sections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","position","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"position":{"type":"string","minLength":1}},"required":["name"]}}}},"responses":{"201":{"description":"Skill section created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","position","createdAt","updatedAt"]}},"required":["data"]}}}}}}},"/skill-sections/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"position":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"Skill section updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","position","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Skill section not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Skill section deleted"},"404":{"description":"Skill section not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/skills":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"List of skills","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["organization","system"]},"organizationId":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["membershipId","userId","firstName","lastName","email"]}},"required":["id","type","organizationId","skillSectionId","name","description","instructions","status","createdAt","updatedAt","createdBy"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true,"maxLength":255},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]}}}}}},"responses":{"201":{"description":"Skill created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["organization","system"]},"organizationId":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["membershipId","userId","firstName","lastName","email"]}},"required":["id","type","organizationId","skillSectionId","name","description","instructions","status","createdAt","updatedAt","createdBy"]}},"required":["data"]}}}}}}},"/skills/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Skill found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["organization","system"]},"organizationId":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["membershipId","userId","firstName","lastName","email"]}},"required":["id","type","organizationId","skillSectionId","name","description","instructions","status","createdAt","updatedAt","createdBy"]}},"required":["data"]}}}},"404":{"description":"Skill not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true,"maxLength":255},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]}}}}}},"responses":{"200":{"description":"Skill updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["organization","system"]},"organizationId":{"type":"string","nullable":true},"skillSectionId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"status":{"type":"string","enum":["draft","published"]},"createdAt":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true},"createdBy":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string"},"userId":{"type":"string"},"firstName":{"type":"string","nullable":true},"lastName":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["membershipId","userId","firstName","lastName","email"]}},"required":["id","type","organizationId","skillSectionId","name","description","instructions","status","createdAt","updatedAt","createdBy"]}},"required":["data"]}}}},"404":{"description":"Skill not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Skill deleted"},"404":{"description":"Skill not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/skills/{id}/generate":{"post":{"tags":["Skills"],"summary":"Apply a natural-language edit to a skill","description":"Sends a prompt to the LLM editor for the given skill. The LLM may call tools to update the skill's name, description, or instructions. Returns once all tool calls have completed.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":1,"maxLength":8000}},"required":["prompt"]}}}},"responses":{"200":{"description":"Edit applied","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"404":{"description":"Skill not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/release-notes/feed":{"get":{"responses":{"200":{"description":"Published changelog entries from the docs RSS feed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"publishedAt":{"type":"string","nullable":true},"url":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","title","description","publishedAt","url","tags"]}}},"required":["data"]}}}},"502":{"description":"Changelog feed could not be loaded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/search":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","description":"Comma-separated result types. Defaults to all result types.","example":"ticket,work_item,employee,team,brand,board,report,calibration"},"required":false,"name":"types","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Search workspace resources","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["knowledge_base_document","membership","employee","customer","company","ticket","work_item","team","brand","board","report","calibration","complaint_type","chat"]},"id":{"type":"string"},"title":{"type":"string"},"subtitle":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"matched_on":{"type":"string","enum":["external_id","jira_issue_key","prefix_id","email","name","subject","description","content"],"description":"Which column produced the hit."},"tier":{"type":"integer","minimum":0,"maximum":3,"description":"Relevance tier, ascending: 0 exact identifier, 1 identifier prefix, 2 full-text, 3 fuzzy. Results are pre-sorted by tier, so clients must not re-rank."},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","id","title","subtitle","url","matched_on","tier","metadata"]}}},"required":["data"]}}}},"400":{"description":"Invalid search request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard-mention-search":{"get":{"parameters":[{"schema":{"type":"string","maxLength":200},"required":true,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"types","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Search active knowledge-library documents, sections, macros and groups for mentions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["knowledge_base_document","knowledge_base_section","macro","group"]}},"required":["id","name","type"]}}},"required":["data"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string"},"required":false,"name":"compliance_test_id","in":"query"}],"responses":{"200":{"description":"Sheets for the current organization, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_rows_count":{"type":"number"},"filters":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"operator":{"type":"string","enum":["contains","does_not_contain","eq","not_eq","starts_with","ends_with","lt","gt","lte","gte","includes"]},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["sheet_column_id","operator","value"]}},"sort":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["sheet_column_id","direction"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","position","sheet_rows_count","filters","sort","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet":{"type":"object","properties":{"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"sort":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}}}},"required":["sheet"]}}}},"responses":{"201":{"description":"Created sheet","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_rows_count":{"type":"number"},"filters":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"operator":{"type":"string","enum":["contains","does_not_contain","eq","not_eq","starts_with","ends_with","lt","gt","lte","gte","includes"]},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["sheet_column_id","operator","value"]}},"sort":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["sheet_column_id","direction"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"sheet_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}}},"required":["id","name","position","sheet_rows_count","filters","sort","created_at","updated_at","sheet_columns"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Sheet with its columns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_rows_count":{"type":"number"},"filters":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"operator":{"type":"string","enum":["contains","does_not_contain","eq","not_eq","starts_with","ends_with","lt","gt","lte","gte","includes"]},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["sheet_column_id","operator","value"]}},"sort":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["sheet_column_id","direction"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"sheet_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}}},"required":["id","name","position","sheet_rows_count","filters","sort","created_at","updated_at","sheet_columns"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet":{"type":"object","properties":{"name":{"type":"string"},"filters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"sort":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}}}},"required":["sheet"]}}}},"responses":{"200":{"description":"Updated sheet","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_rows_count":{"type":"number"},"filters":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"operator":{"type":"string","enum":["contains","does_not_contain","eq","not_eq","starts_with","ends_with","lt","gt","lte","gte","includes"]},"value":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]}},"required":["sheet_column_id","operator","value"]}},"sort":{"type":"array","items":{"type":"object","properties":{"sheet_column_id":{"type":"string"},"direction":{"type":"string","enum":["asc","desc"]}},"required":["sheet_column_id","direction"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"sheet_columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}}},"required":["id","name","position","sheet_rows_count","filters","sort","created_at","updated_at","sheet_columns"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Sheet deleted"},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{id}/export":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"CSV export of the sheet (group columns excluded)","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{sheet_id}/sheet_rows":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sheet_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Rows of the sheet in position order, with cells","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_cells":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true},"generation_status":{"type":"string","nullable":true},"reasoning_citations":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"citable_type":{"type":"string"},"citable_id":{"type":"string","nullable":true},"citable_title":{"type":"string","nullable":true},"citable_content":{"type":"string","nullable":true},"citable_open_url":{"type":"string","nullable":true}},"required":["index","citable_type","citable_id","citable_title","citable_content","citable_open_url"]}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","sheet_row_id","sheet_column_id","content","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","position","sheet_cells","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{sheet_id}/sheet_rows/batch":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sheet_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet_rows":{"type":"object","properties":{"create":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"object","properties":{"before":{"type":"string","nullable":true},"after":{"type":"string","nullable":true}},"additionalProperties":false}}}},"delete":{"type":"array","items":{"type":"string"}},"reposition":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"object","properties":{"before":{"type":"string","nullable":true},"after":{"type":"string","nullable":true}},"additionalProperties":false}},"required":["id","position"]}}}}},"required":["sheet_rows"]}}}},"responses":{"200":{"description":"Rows created by the batch","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","nullable":true},"sheet_cells":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true},"generation_status":{"type":"string","nullable":true},"reasoning_citations":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"citable_type":{"type":"string"},"citable_id":{"type":"string","nullable":true},"citable_title":{"type":"string","nullable":true},"citable_content":{"type":"string","nullable":true},"citable_open_url":{"type":"string","nullable":true}},"required":["index","citable_type","citable_id","citable_title","citable_content","citable_open_url"]}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","sheet_row_id","sheet_column_id","content","created_at","updated_at"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","position","sheet_cells","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{sheet_id}/sheet_columns":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sheet_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 200 are clamped to 200","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Columns of the sheet in position order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sheet_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet_column":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"width":{"type":"integer"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"position":{"type":"object","properties":{"before":{"type":"string","nullable":true},"after":{"type":"string","nullable":true}},"additionalProperties":false},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string"},"record_type":{"type":"string","nullable":true},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","nullable":true},"value":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["value"]}]}}}}}}},"required":["sheet_column"]}}}},"responses":{"201":{"description":"Created column","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheet_columns/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet_column":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"width":{"type":"integer"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"position":{"type":"object","properties":{"before":{"type":"string","nullable":true},"after":{"type":"string","nullable":true}},"additionalProperties":false},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string"},"record_type":{"type":"string","nullable":true},"values":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"object","properties":{"id":{"type":"string","nullable":true},"value":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["value"]}]}}}}}}},"required":["sheet_column"]}}}},"responses":{"200":{"description":"Updated column","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"column_type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"label":{"type":"string"},"instructions":{"type":"string","nullable":true},"unique_values":{"type":"boolean"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["string","enum","date","boolean","url","record","group"]},"values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"type":"string"},"color":{"type":"string","enum":["neutral","red","orange","amber","green","blue","purple"]}},"required":["id","value"]}},"record_type":{"type":"string","nullable":true,"enum":["conversation","risk_scenario","compliance_case","compliance_alert","employee","customer","dispute"]}}},"position":{"type":"number"},"width":{"type":"number"},"pinned":{"type":"string","nullable":true,"enum":["left","right"]},"parent_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","column_type","label","instructions","unique_values","options","position","width","pinned","parent_id","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Column deleted"},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheet_cells/upsert":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet_cell":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true}},"required":["sheet_row_id","sheet_column_id"]}},"required":["sheet_cell"]}}}},"responses":{"200":{"description":"Upserted cell","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true},"generation_status":{"type":"string","nullable":true},"reasoning_citations":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"citable_type":{"type":"string"},"citable_id":{"type":"string","nullable":true},"citable_title":{"type":"string","nullable":true},"citable_content":{"type":"string","nullable":true},"citable_open_url":{"type":"string","nullable":true}},"required":["index","citable_type","citable_id","citable_title","citable_content","citable_open_url"]}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","sheet_row_id","sheet_column_id","content","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheet_cells/batch_upsert":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sheet_cells":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true}},"required":["sheet_row_id","sheet_column_id"]},"minItems":1}},"required":["sheet_cells"]}}}},"responses":{"200":{"description":"Upserted cells","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"sheet_row_id":{"type":"string"},"sheet_column_id":{"type":"string"},"content":{"type":"string","nullable":true},"reasoning":{"type":"string","nullable":true},"expanded_content":{"type":"string","nullable":true},"generation_status":{"type":"string","nullable":true},"reasoning_citations":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"},"citable_type":{"type":"string"},"citable_id":{"type":"string","nullable":true},"citable_title":{"type":"string","nullable":true},"citable_content":{"type":"string","nullable":true},"citable_open_url":{"type":"string","nullable":true}},"required":["index","citable_type","citable_id","citable_title","citable_content","citable_open_url"]}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","sheet_row_id","sheet_column_id","content","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheets/{sheet_id}/sheet_versions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"sheet_id","in":"path"}],"responses":{"200":{"description":"Versions of the sheet, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"version_number":{"type":"number"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]}},"required":["id","account"]},"change_summary":{"type":"object","additionalProperties":{"type":"number"}}},"required":["id","version_number","description","created_at","membership","change_summary"]}}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheet_versions/{id}/preview":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Sheet state as of the version","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"columns":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"column_type":{"type":"string"},"options":{"type":"object","nullable":true,"properties":{"type":{"type":"string"},"record_type":{"type":"string","nullable":true}}},"position":{"type":"number"}},"required":["id","label","column_type","options","position"]}},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number","nullable":true},"cells":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["id","position","cells"]}},"changes":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"row_id":{"type":"string","nullable":true},"column_id":{"type":"string","nullable":true}},"required":["type"]}}},"required":["columns","rows","changes"]}},"required":["data"]}}}},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sheet_versions/{id}/restore":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Sheet restored to the version"},"404":{"description":"Record not found in the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/seed":{"post":{"responses":{"200":{"description":"Seed catalog data from stubs","content":{"application/json":{"schema":{"type":"object","properties":{"frameworks":{"type":"integer"},"regulations":{"type":"integer"},"linksAdded":{"type":"integer"},"linksRemoved":{"type":"integer"},"skippedFrameworkSlugs":{"type":"array","items":{"type":"string"}},"regulationsSkippedReconciliation":{"type":"integer"}},"required":["frameworks","regulations","linksAdded","linksRemoved","skippedFrameworkSlugs","regulationsSkippedReconciliation"]}}}}}}},"/admin/frameworks":{"get":{"responses":{"200":{"description":"List of all frameworks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":255},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}}},"required":["slug","name"]}}}},"responses":{"201":{"description":"Framework created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["data"]}}}},"409":{"description":"Framework with this slug already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/frameworks/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Framework found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Framework not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":255},"name":{"type":"string","minLength":1,"maxLength":255},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Framework updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Framework not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Slug already in use","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/regulations":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"frameworkId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List of regulations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true}},"required":["title"]}}}},"responses":{"201":{"description":"Regulation created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}},"required":["data"]}}}},"409":{"description":"Regulation with this external_id already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/regulations/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Regulation found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt","frameworks"]}},"required":["data"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":500},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Regulation updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"external_id already in use","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Regulation deleted"},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/regulations/scrape":{"post":{"responses":{"200":{"description":"Scrape jobs queued for all regulations with source URLs","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"integer"}},"required":["queued"]}}}}}}},"/admin/regulations/{id}/scrape":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scrape job queued for a single regulation","content":{"application/json":{"schema":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/frameworks/{frameworkId}/regulations":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"frameworkId","in":"path"}],"responses":{"200":{"description":"Regulations linked to framework","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}}},"required":["data"]}}}},"404":{"description":"Framework not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"frameworkId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"regulationId":{"type":"string"}},"required":["regulationId"]}}}},"responses":{"201":{"description":"Regulation linked to framework","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Framework or regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Already linked","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/frameworks/{frameworkId}/regulations/{regulationId}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"frameworkId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"regulationId","in":"path"}],"responses":{"204":{"description":"Regulation unlinked from framework"},"404":{"description":"Link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/regulations/{regulationId}/revisions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"regulationId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List of revisions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"regulationId":{"type":"string"},"totalBytes":{"type":"number","nullable":true},"contentHash":{"type":"string","nullable":true},"fetchedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","regulationId","totalBytes","contentHash","fetchedAt","createdAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"regulationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","nullable":true},"totalBytes":{"type":"integer","nullable":true},"contentHash":{"type":"string","nullable":true},"fetchedAt":{"type":"string","nullable":true,"format":"date-time"},"tocEntries":{"type":"array","items":{"type":"object","properties":{"parentIndex":{"type":"integer","nullable":true},"title":{"type":"string"},"level":{"type":"integer"},"startOffset":{"type":"integer","nullable":true}},"required":["title","level"]}}}}}}},"responses":{"201":{"description":"Revision created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"regulationId":{"type":"string"},"totalBytes":{"type":"number","nullable":true},"contentHash":{"type":"string","nullable":true},"fetchedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"body":{"type":"string","nullable":true},"tocEntries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"regulationRevisionId":{"type":"string"},"parentId":{"type":"string","nullable":true},"title":{"type":"string"},"level":{"type":"integer"},"startOffset":{"type":"number","nullable":true}},"required":["id","regulationRevisionId","parentId","title","level","startOffset"]}}},"required":["id","regulationId","totalBytes","contentHash","fetchedAt","createdAt","body","tocEntries"]}},"required":["data"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Revision with this content already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid TOC parentId references","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/regulations/{regulationId}/revisions/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"regulationId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Revision found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"regulationId":{"type":"string"},"totalBytes":{"type":"number","nullable":true},"contentHash":{"type":"string","nullable":true},"fetchedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"body":{"type":"string","nullable":true},"tocEntries":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"regulationRevisionId":{"type":"string"},"parentId":{"type":"string","nullable":true},"title":{"type":"string"},"level":{"type":"integer"},"startOffset":{"type":"number","nullable":true}},"required":["id","regulationRevisionId","parentId","title","level","startOffset"]}}},"required":["id","regulationId","totalBytes","contentHash","fetchedAt","createdAt","body","tocEntries"]}},"required":["data"]}}}},"404":{"description":"Revision not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/regulations/metadata":{"get":{"responses":{"200":{"description":"Regulation catalog metadata (enum values)","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"authorities":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}},"jurisdictions":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}}},"required":["categories","authorities","jurisdictions"]}}}}}}},"/frameworks":{"get":{"responses":{"200":{"description":"All available frameworks with org subscription state","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"regulationsCount":{"type":"integer"},"lastRefreshAt":{"type":"string","nullable":true},"subscriptionId":{"type":"string","nullable":true},"enabled":{"type":"boolean"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt","regulationsCount","lastRefreshAt","subscriptionId","enabled"]}}},"required":["data"]}}}}}}},"/regulations":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"frameworkId","in":"query"}],"responses":{"200":{"description":"Regulations available to the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt"]}}},"required":["data"]}}}}}}},"/regulations/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Regulation found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"category":{"type":"string","nullable":true},"authorities":{"type":"array","items":{"type":"string"}},"jurisdictions":{"type":"array","items":{"type":"string"}},"attributes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"sourceUrls":{"type":"array","items":{"type":"string"}},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"frameworks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}}},"required":["id","title","description","category","authorities","jurisdictions","attributes","sourceUrls","externalId","createdAt","updatedAt","frameworks"]}},"required":["data"]}}}},"404":{"description":"Regulation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization-frameworks":{"get":{"responses":{"200":{"description":"Organization framework subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"frameworkId":{"type":"string"},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"framework":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["id","organizationId","frameworkId","enabled","createdAt","framework"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"frameworkId":{"type":"string"},"enabled":{"type":"boolean"}},"required":["frameworkId"]}}}},"responses":{"201":{"description":"Subscription created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"frameworkId":{"type":"string"},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"framework":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["id","organizationId","frameworkId","enabled","createdAt","framework"]}},"required":["data"]}}}},"404":{"description":"Framework not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Already subscribed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization-frameworks/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Subscription updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"frameworkId":{"type":"string"},"enabled":{"type":"boolean"},"createdAt":{"type":"string"},"framework":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"jurisdictions":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","slug","name","description","jurisdictions","createdAt","updatedAt"]}},"required":["id","organizationId","frameworkId","enabled","createdAt","framework"]}},"required":["data"]}}}},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Subscription deleted"},"404":{"description":"Subscription not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/regulations/{id}/content":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100000,"default":40000},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Byte-range slice of the regulation content","content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string"},"startOffset":{"type":"integer"},"endOffset":{"type":"integer"},"limit":{"type":"integer"},"totalBytes":{"type":"integer"},"hasMore":{"type":"boolean"}},"required":["text","startOffset","endOffset","limit","totalBytes","hasMore"]}}}},"404":{"description":"Regulation or revision not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/regulatory-corpus/frameworks":{"get":{"tags":["Regulatory corpus"],"summary":"List frameworks with regulatory chat corpus","responses":{"200":{"description":"Frameworks available for corpus-backed chat","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"shortName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceCount":{"type":"integer"},"totalBytes":{"type":"integer"},"contextHash":{"type":"string"}},"required":["slug","shortName","name","description","sourceCount","totalBytes","contextHash"]}},"meta":{"type":"object","properties":{"corpusGeneratedAt":{"type":"string"},"disclaimer":{"type":"string"}},"required":["corpusGeneratedAt","disclaimer"]}},"required":["data","meta"]}}}}}}},"/regulatory-corpus/frameworks/{slug}":{"get":{"tags":["Regulatory corpus"],"summary":"Get regulatory chat metadata for a framework","parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Framework corpus metadata","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"slug":{"type":"string"},"shortName":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"sourceCount":{"type":"integer"},"totalBytes":{"type":"integer"},"contextHash":{"type":"string"},"sourceIndex":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"regulationTitle":{"type":"string"},"url":{"type":"string"},"category":{"type":"string"},"byteLength":{"type":"integer"}},"required":["id","title","regulationTitle","url","category","byteLength"]}},"corpusGeneratedAt":{"type":"string"}},"required":["slug","shortName","name","description","sourceCount","totalBytes","contextHash","sourceIndex","corpusGeneratedAt"]}},"required":["data"]}}}},"404":{"description":"Unknown framework","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/regulatory-corpus/chat":{"post":{"tags":["Regulatory corpus"],"summary":"Stream regulatory corpus chat for a framework","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"frameworkSlug":{"type":"string"},"model":{"type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string","enum":["user","assistant","system"]}},"required":["id","role"]},"default":[]}},"required":["frameworkSlug"]}}}},"responses":{"200":{"description":"UI message stream (SSE)","content":{"text/event-stream":{"schema":{"type":"string"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/evaluations":{"get":{"operationId":"getConversationStatisticsEvaluations","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"evaluations_count_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"ai_evaluations_count":{"type":"number"},"manual_evaluations_count":{"type":"number"}},"required":["date","ai_evaluations_count","manual_evaluations_count"]}},"ai_manual_qa_score_match_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"ai_manual_qa_score_match":{"type":"number","nullable":true}},"required":["date","ai_manual_qa_score_match"]}},"evaluations_by_evaluator":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"conversations_count":{"type":"number"}},"required":["id","name","conversations_count"]}}},"required":["evaluations_count_by_date","ai_manual_qa_score_match_by_date","evaluations_by_evaluator"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/handling_time":{"get":{"operationId":"getConversationStatisticsHandlingTime","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"average_handling_time_seconds":{"type":"number","nullable":true},"previous_average_handling_time_seconds":{"type":"number","nullable":true},"average_handling_time_seconds_change":{"type":"number","nullable":true},"conversations_count":{"type":"number"},"previous_conversations_count":{"type":"number"},"resolved_conversations_count":{"type":"number"},"previous_resolved_conversations_count":{"type":"number"},"conversations_count_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"]}},"resolved_conversations_count_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"]}},"top_ten_customers_with_longest_average_handling_time":{"type":"array","items":{"type":"object","properties":{"client_id":{"type":"string"},"client_name":{"type":"string","nullable":true},"average_handling_time_seconds":{"type":"number"},"conversations_count":{"type":"number"}},"required":["client_id","client_name","average_handling_time_seconds","conversations_count"]}}},"required":["average_handling_time_seconds","previous_average_handling_time_seconds","average_handling_time_seconds_change","conversations_count","previous_conversations_count","resolved_conversations_count","previous_resolved_conversations_count","conversations_count_by_date","resolved_conversations_count_by_date","top_ten_customers_with_longest_average_handling_time"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/handling_time/summary":{"get":{"operationId":"getConversationStatisticsHandlingTimeSummary","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"average_handling_time_seconds":{"type":"number","nullable":true},"previous_average_handling_time_seconds":{"type":"number","nullable":true},"average_handling_time_seconds_change":{"type":"number","nullable":true}},"required":["average_handling_time_seconds","previous_average_handling_time_seconds","average_handling_time_seconds_change"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/product_issues":{"get":{"operationId":"getConversationStatisticsProductIssues","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"top_ten_product_issues_by_conversations_count":{"type":"array","items":{"type":"object","properties":{"customer_issue_id":{"type":"string"},"customer_issue_name":{"type":"string","nullable":true},"customer_issue_description":{"type":"string","nullable":true},"conversations_count":{"type":"number"},"conversations_count_fraction":{"type":"number","nullable":true}},"required":["customer_issue_id","customer_issue_name","customer_issue_description","conversations_count","conversations_count_fraction"]}},"top_ten_product_issues_by_average_handling_time":{"type":"array","items":{"type":"object","properties":{"customer_issue_id":{"type":"string"},"customer_issue_name":{"type":"string","nullable":true},"customer_issue_description":{"type":"string","nullable":true},"average_handling_time_seconds":{"type":"number","nullable":true},"conversations_count":{"type":"number"}},"required":["customer_issue_id","customer_issue_name","customer_issue_description","average_handling_time_seconds","conversations_count"]}},"conversations_count_by_product_issue_and_date":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"}},"required":["date"],"additionalProperties":{"type":"number","nullable":true}}},"labels":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data","labels"]}},"required":["top_ten_product_issues_by_conversations_count","top_ten_product_issues_by_average_handling_time","conversations_count_by_product_issue_and_date"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/repeat_engagement":{"get":{"operationId":"getConversationStatisticsRepeatEngagement","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"top_ten_customer_issues_by_fcr":{"type":"array","items":{"type":"object","properties":{"customer_issue_id":{"type":"string"},"customer_issue_name":{"type":"string","nullable":true},"customer_issue_description":{"type":"string","nullable":true},"root_conversations_count":{"type":"number"},"fcr_conversations_count":{"type":"number"},"fcr_rate":{"type":"number","nullable":true},"adjusted_fcr_rate":{"type":"number","nullable":true}},"required":["customer_issue_id","customer_issue_name","customer_issue_description","root_conversations_count","fcr_conversations_count","fcr_rate","adjusted_fcr_rate"]}}},"required":["top_ten_customer_issues_by_fcr"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/sentiment":{"get":{"operationId":"getConversationStatisticsSentiment","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"average_customer_sentiment_score":{"type":"number","nullable":true},"previous_average_customer_sentiment_score":{"type":"number","nullable":true},"average_customer_sentiment_score_change":{"type":"number","nullable":true}},"required":["average_customer_sentiment_score","previous_average_customer_sentiment_score","average_customer_sentiment_score_change"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/average_qa_score_by_scorecard_and_agent":{"get":{"operationId":"getConversationStatisticsAverageQaScoreByScorecardAndAgent","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"scorecard_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_id","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"nullable":true},"maxItems":0},{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number","nullable":true}},"required":["date","value"]}},"labels":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data","labels"]}]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/average_qa_score_by_scorecard_and_team":{"get":{"operationId":"getConversationStatisticsAverageQaScoreByScorecardAndTeam","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"scorecard_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_id","in":"query"}],"responses":{"200":{"description":"Statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"anyOf":[{"type":"array","items":{"nullable":true},"maxItems":0},{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"value":{"type":"number","nullable":true}},"required":["date","value"]}},"labels":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data","labels"]}]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/statistics/export":{"get":{"operationId":"exportConversationStatistics","tags":["Conversation statistics"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"manager_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_performance_report_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignment_queue_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"scorecard_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_id","in":"query"},{"schema":{"type":"string"},"required":true,"name":"statistic_type","in":"query"},{"schema":{"type":"string"},"required":true,"name":"metric_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"adherence_scorecard_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"scorecard_criterion_id","in":"query"}],"responses":{"200":{"description":"CSV for one metric type, ZIP of CSVs for several","content":{"text/csv":{"schema":{"type":"string"}},"application/zip":{"schema":{"type":"string","format":"binary"}}}},"400":{"description":"Unknown statistic/metric type or invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Statistics cannot be scoped for this member","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Statistics unavailable for this organization","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/report-types":{"get":{"responses":{"200":{"description":"List of report types","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"systemKey":{"type":"string","nullable":true,"enum":["customer_insights"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"template":{"type":"string","nullable":true},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true},"dayOfMonth":{"type":"integer","nullable":true},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string"},"channelId":{"type":"string"}},"required":["connectionId","channelId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","systemKey","name","description","instructions","schema","template","scheduleEnabled","frequency","dayOfWeek","dayOfMonth","timeOfDay","timezone","channels","emailRecipients","slackTargets","scope","variables","nextRunAt","lastRunAt","createdAt","updatedAt"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"instructions":{"type":"string","minLength":1},"schema":{"type":"object","additionalProperties":{"nullable":true}},"template":{"type":"string","minLength":1},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"channelId":{"type":"string","minLength":1}},"required":["connectionId","channelId"]}},"slackUserTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"slackUserId":{"type":"string","minLength":1},"slackUserName":{"type":"string"}},"required":["connectionId","slackUserId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name"]}}}},"responses":{"201":{"description":"Report type created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"systemKey":{"type":"string","nullable":true,"enum":["customer_insights"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"template":{"type":"string","nullable":true},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true},"dayOfMonth":{"type":"integer","nullable":true},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string"},"channelId":{"type":"string"}},"required":["connectionId","channelId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","systemKey","name","description","instructions","schema","template","scheduleEnabled","frequency","dayOfWeek","dayOfMonth","timeOfDay","timezone","channels","emailRecipients","slackTargets","scope","variables","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid delivery config","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/report-types/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Report type found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"systemKey":{"type":"string","nullable":true,"enum":["customer_insights"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"template":{"type":"string","nullable":true},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true},"dayOfMonth":{"type":"integer","nullable":true},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string"},"channelId":{"type":"string"}},"required":["connectionId","channelId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","systemKey","name","description","instructions","schema","template","scheduleEnabled","frequency","dayOfWeek","dayOfMonth","timeOfDay","timezone","channels","emailRecipients","slackTargets","scope","variables","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"template":{"type":"string","nullable":true},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true,"minimum":0,"maximum":6},"dayOfMonth":{"type":"integer","nullable":true,"minimum":1,"maximum":31},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"channelId":{"type":"string","minLength":1}},"required":["connectionId","channelId"]}},"slackUserTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","minLength":1},"slackUserId":{"type":"string","minLength":1},"slackUserName":{"type":"string"}},"required":["connectionId","slackUserId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"responses":{"200":{"description":"Report type updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"systemKey":{"type":"string","nullable":true,"enum":["customer_insights"]},"name":{"type":"string"},"description":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"template":{"type":"string","nullable":true},"scheduleEnabled":{"type":"boolean"},"frequency":{"type":"string","nullable":true,"enum":["daily","weekly","monthly"]},"dayOfWeek":{"type":"integer","nullable":true},"dayOfMonth":{"type":"integer","nullable":true},"timeOfDay":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"string","enum":["email","slack"]}},"emailRecipients":{"type":"array","items":{"type":"string"}},"slackTargets":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string"},"channelId":{"type":"string"}},"required":["connectionId","channelId"]}},"scope":{"type":"object","additionalProperties":{"nullable":true}},"variables":{"type":"object","additionalProperties":{"nullable":true}},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","systemKey","name","description","instructions","schema","template","scheduleEnabled","frequency","dayOfWeek","dayOfMonth","timeOfDay","timezone","channels","emailRecipients","slackTargets","scope","variables","nextRunAt","lastRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"No fields to update or invalid config","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Report type deleted"},"400":{"description":"Built-in report types cannot be deleted","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/report-types/{id}/run":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"periodStart":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodEnd":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"deliver":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Report type run result","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reportId":{"type":"string"},"status":{"type":"string"},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"deliveryResults":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string"},"target":{"type":"string"},"ok":{"type":"boolean"},"error":{"type":"string"}},"required":["channel","target","ok"]}},"error":{"type":"string"}},"required":["reportId","status","periodStart","periodEnd","deliveryResults"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/report-templates":{"get":{"responses":{"200":{"description":"List reusable report templates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"version":{"type":"integer"}},"required":["id","name","description","version"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/reports":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"reportTypeId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List of reports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"reportTypeId":{"type":"string","nullable":true},"reportTemplateId":{"type":"string","nullable":true},"reportTemplateVersion":{"type":"integer","nullable":true},"workflowRunId":{"type":"string","nullable":true},"invocationKey":{"type":"string","nullable":true},"invocationScope":{"type":"object","additionalProperties":{"nullable":true}},"subjectEmployeeId":{"type":"number","nullable":true},"teamId":{"type":"number","nullable":true},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"title":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"structuredData":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"resolvedVariables":{"type":"object","additionalProperties":{"nullable":true}},"deliveryResults":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["email","slack"]},"target":{"type":"string"},"ok":{"type":"boolean"},"error":{"type":"string"}},"required":["channel","target","ok"]}},"status":{"type":"string"},"sentTo":{"type":"array","nullable":true,"items":{"type":"string"}},"generatedAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","reportTypeId","reportTemplateId","reportTemplateVersion","workflowRunId","invocationKey","invocationScope","subjectEmployeeId","teamId","periodStart","periodEnd","title","content","structuredData","resolvedVariables","deliveryResults","status","sentTo","generatedAt","sentAt","createdAt","updatedAt"]}},"nextCursor":{"type":"string","nullable":true}},"required":["data","nextCursor"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report type not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/reports/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Report found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"reportTypeId":{"type":"string","nullable":true},"reportTemplateId":{"type":"string","nullable":true},"reportTemplateVersion":{"type":"integer","nullable":true},"workflowRunId":{"type":"string","nullable":true},"invocationKey":{"type":"string","nullable":true},"invocationScope":{"type":"object","additionalProperties":{"nullable":true}},"subjectEmployeeId":{"type":"number","nullable":true},"teamId":{"type":"number","nullable":true},"periodStart":{"type":"string"},"periodEnd":{"type":"string"},"title":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"structuredData":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"resolvedVariables":{"type":"object","additionalProperties":{"nullable":true}},"deliveryResults":{"type":"array","items":{"type":"object","properties":{"channel":{"type":"string","enum":["email","slack"]},"target":{"type":"string"},"ok":{"type":"boolean"},"error":{"type":"string"}},"required":["channel","target","ok"]}},"status":{"type":"string"},"sentTo":{"type":"array","nullable":true,"items":{"type":"string"}},"generatedAt":{"type":"string","nullable":true},"sentAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","reportTypeId","reportTemplateId","reportTemplateVersion","workflowRunId","invocationKey","invocationScope","subjectEmployeeId","teamId","periodStart","periodEnd","title","content","structuredData","resolvedVariables","deliveryResults","status","sentTo","generatedAt","sentAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Report not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Report deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Report not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/summary-snapshots":{"get":{"parameters":[{"schema":{"type":"string","enum":["team","brand","team_lead","agent"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subject_id","in":"query"},{"schema":{"type":"string","enum":["overview"],"default":"overview"},"required":false,"name":"summary_type","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"}],"responses":{"200":{"description":"Cached or generated performance summary snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"summary_type":{"type":"string","enum":["overview"]},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"body":{"type":"string"},"metrics_snapshot":{"type":"object","additionalProperties":{"nullable":true}},"input_hash":{"type":"string"},"prompt_version":{"type":"string"},"model":{"type":"string"},"generated_by_membership_id":{"type":"string","nullable":true},"generated_at":{"type":"string","format":"date-time"},"stale_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","subject_type","subject_id","summary_type","start_date","end_date","previous_start_date","previous_end_date","body","metrics_snapshot","input_hash","prompt_version","model","generated_by_membership_id","generated_at","stale_at","created_at","updated_at"]},"generated":{"type":"boolean"}},"required":["data","generated"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Summary generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/summary-snapshots/regenerate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string","minLength":1},"summary_type":{"type":"string","enum":["overview"],"default":"overview"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["subject_type","subject_id","start_date","end_date"]}}}},"responses":{"200":{"description":"Cached or generated performance summary snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"summary_type":{"type":"string","enum":["overview"]},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"body":{"type":"string"},"metrics_snapshot":{"type":"object","additionalProperties":{"nullable":true}},"input_hash":{"type":"string"},"prompt_version":{"type":"string"},"model":{"type":"string"},"generated_by_membership_id":{"type":"string","nullable":true},"generated_at":{"type":"string","format":"date-time"},"stale_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","subject_type","subject_id","summary_type","start_date","end_date","previous_start_date","previous_end_date","body","metrics_snapshot","input_hash","prompt_version","model","generated_by_membership_id","generated_at","stale_at","created_at","updated_at"]},"generated":{"type":"boolean"}},"required":["data","generated"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Summary generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands/{brand_id}/overview":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brand_id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"critical_errors_limit","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"contact_reasons_limit","in":"query"}],"responses":{"200":{"description":"Performance brand overview found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"metrics":{"type":"object","properties":{"subject_type":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"subject_id":{"type":"string","nullable":true},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"ai_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"manual_evaluations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"reviewed_conversations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"approved_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"resolved_tickets":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"average_handling_time":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","qa_score","ai_reviews","manual_evaluations","reviewed_conversations","approved_reviews","resolved_tickets","average_handling_time"]},"scorecard_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"critical_errors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"total_count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_rate":{"type":"number","nullable":true},"rate_delta":{"type":"number","nullable":true}},"required":["id","label","count","total_count","previous_count","count_delta","rate","previous_rate","rate_delta"]}},"contact_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","previous_score","previous_count","score_delta","count_delta"]}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"critical_error_count":{"type":"integer"},"critical_error_rate":{"type":"number","nullable":true},"criterion_pass_rate":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"previous_critical_error_count":{"type":"integer"},"previous_critical_error_rate":{"type":"number","nullable":true},"previous_criterion_pass_rate":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","high_count","medium_count","low_count","critical_error_count","critical_error_rate","criterion_pass_rate","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","previous_critical_error_count","previous_critical_error_rate","previous_criterion_pass_rate","score_delta","count_delta"]}},"score_distribution":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["high","medium","low"]},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["level","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"child_criteria_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true},"parent_id":{"type":"string"},"parent_label":{"type":"string"}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta","parent_id","parent_label"]}},"feedback_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"parent_criterion_id":{"type":"string"},"parent_criterion_label":{"type":"string"},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","label","scorecard_id","scorecard_name","parent_criterion_id","parent_criterion_label","criterion_id","criterion_label","count","previous_count","count_delta"]}},"failing_check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"check_id":{"type":"string"},"check_description":{"type":"string"},"knowledge_base_answer":{"type":"string","nullable":true},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"result":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"selected_justification_option_label":{"type":"string","nullable":true},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","check_id","check_description","knowledge_base_answer","scorecard_id","scorecard_name","criterion_id","criterion_label","result","selected_justification_option_id","selected_justification_option_label","count","previous_count","count_delta"]}},"agent_scores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","name","score","count","high_count","medium_count","low_count","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","score_delta","count_delta"]}},"peer_benchmark":{"type":"object","nullable":true,"properties":{"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"agent_score":{"type":"number","nullable":true},"agent_previous_score":{"type":"number","nullable":true},"agent_score_delta":{"type":"number","nullable":true},"agent_evaluations_count":{"type":"integer"},"team_score":{"type":"number","nullable":true},"team_previous_score":{"type":"number","nullable":true},"team_score_delta":{"type":"number","nullable":true},"team_evaluations_count":{"type":"integer"},"agent_rank":{"type":"integer","nullable":true},"ranked_agents_count":{"type":"integer"},"agents_above_count":{"type":"integer"},"agents_below_count":{"type":"integer"},"agent_percentile":{"type":"number","nullable":true}},"required":["team_id","team_name","agent_score","agent_previous_score","agent_score_delta","agent_evaluations_count","team_score","team_previous_score","team_score_delta","team_evaluations_count","agent_rank","ranked_agents_count","agents_above_count","agents_below_count","agent_percentile"]},"scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","name","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"score_option_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["type","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"movements":{"type":"object","properties":{"agents":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"criteria":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"channels":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"contact_reasons":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]}},"required":["agents","criteria","channels","contact_reasons"]},"peer_channel_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"peer_criterion_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"review_context":{"type":"object","properties":{"total_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"ai_count":{"type":"integer"},"previous_ai_count":{"type":"integer"},"manual_count":{"type":"integer"},"previous_manual_count":{"type":"integer"},"ai_score":{"type":"number","nullable":true},"previous_ai_score":{"type":"number","nullable":true},"manual_score":{"type":"number","nullable":true},"previous_manual_score":{"type":"number","nullable":true},"ai_manual_score_gap":{"type":"number","nullable":true},"previous_ai_manual_score_gap":{"type":"number","nullable":true},"ai_manual_match_score":{"type":"number","nullable":true},"previous_ai_manual_match_score":{"type":"number","nullable":true},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true}},"required":["id","name","count","previous_count","count_delta","average_score","previous_average_score","score_delta"]}}},"required":["total_count","previous_total_count","ai_count","previous_ai_count","manual_count","previous_manual_count","ai_score","previous_ai_score","manual_score","previous_manual_score","ai_manual_score_gap","previous_ai_manual_score_gap","ai_manual_match_score","previous_ai_manual_match_score","reviewers"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","metrics","scorecard_performance","critical_errors","contact_reasons","channels","score_distribution","child_criteria_performance","feedback_reasons","failing_check_results","agent_scores","peer_benchmark","scorecards","score_option_types","movements","peer_channel_benchmarks","peer_criterion_benchmarks","review_context"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance brand overview unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands/{brand_id}/team-leads/{team_lead_membership_id}/overview":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brand_id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"team_lead_membership_id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"critical_errors_limit","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"contact_reasons_limit","in":"query"}],"responses":{"200":{"description":"Performance team lead overview found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"metrics":{"type":"object","properties":{"subject_type":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"subject_id":{"type":"string","nullable":true},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"ai_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"manual_evaluations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"reviewed_conversations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"approved_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"resolved_tickets":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"average_handling_time":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","qa_score","ai_reviews","manual_evaluations","reviewed_conversations","approved_reviews","resolved_tickets","average_handling_time"]},"scorecard_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"critical_errors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"total_count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_rate":{"type":"number","nullable":true},"rate_delta":{"type":"number","nullable":true}},"required":["id","label","count","total_count","previous_count","count_delta","rate","previous_rate","rate_delta"]}},"contact_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","previous_score","previous_count","score_delta","count_delta"]}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"critical_error_count":{"type":"integer"},"critical_error_rate":{"type":"number","nullable":true},"criterion_pass_rate":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"previous_critical_error_count":{"type":"integer"},"previous_critical_error_rate":{"type":"number","nullable":true},"previous_criterion_pass_rate":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","high_count","medium_count","low_count","critical_error_count","critical_error_rate","criterion_pass_rate","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","previous_critical_error_count","previous_critical_error_rate","previous_criterion_pass_rate","score_delta","count_delta"]}},"score_distribution":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["high","medium","low"]},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["level","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"child_criteria_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true},"parent_id":{"type":"string"},"parent_label":{"type":"string"}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta","parent_id","parent_label"]}},"feedback_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"parent_criterion_id":{"type":"string"},"parent_criterion_label":{"type":"string"},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","label","scorecard_id","scorecard_name","parent_criterion_id","parent_criterion_label","criterion_id","criterion_label","count","previous_count","count_delta"]}},"failing_check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"check_id":{"type":"string"},"check_description":{"type":"string"},"knowledge_base_answer":{"type":"string","nullable":true},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"result":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"selected_justification_option_label":{"type":"string","nullable":true},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","check_id","check_description","knowledge_base_answer","scorecard_id","scorecard_name","criterion_id","criterion_label","result","selected_justification_option_id","selected_justification_option_label","count","previous_count","count_delta"]}},"agent_scores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","name","score","count","high_count","medium_count","low_count","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","score_delta","count_delta"]}},"peer_benchmark":{"type":"object","nullable":true,"properties":{"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"agent_score":{"type":"number","nullable":true},"agent_previous_score":{"type":"number","nullable":true},"agent_score_delta":{"type":"number","nullable":true},"agent_evaluations_count":{"type":"integer"},"team_score":{"type":"number","nullable":true},"team_previous_score":{"type":"number","nullable":true},"team_score_delta":{"type":"number","nullable":true},"team_evaluations_count":{"type":"integer"},"agent_rank":{"type":"integer","nullable":true},"ranked_agents_count":{"type":"integer"},"agents_above_count":{"type":"integer"},"agents_below_count":{"type":"integer"},"agent_percentile":{"type":"number","nullable":true}},"required":["team_id","team_name","agent_score","agent_previous_score","agent_score_delta","agent_evaluations_count","team_score","team_previous_score","team_score_delta","team_evaluations_count","agent_rank","ranked_agents_count","agents_above_count","agents_below_count","agent_percentile"]},"scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","name","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"score_option_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["type","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"movements":{"type":"object","properties":{"agents":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"criteria":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"channels":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"contact_reasons":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]}},"required":["agents","criteria","channels","contact_reasons"]},"peer_channel_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"peer_criterion_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"review_context":{"type":"object","properties":{"total_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"ai_count":{"type":"integer"},"previous_ai_count":{"type":"integer"},"manual_count":{"type":"integer"},"previous_manual_count":{"type":"integer"},"ai_score":{"type":"number","nullable":true},"previous_ai_score":{"type":"number","nullable":true},"manual_score":{"type":"number","nullable":true},"previous_manual_score":{"type":"number","nullable":true},"ai_manual_score_gap":{"type":"number","nullable":true},"previous_ai_manual_score_gap":{"type":"number","nullable":true},"ai_manual_match_score":{"type":"number","nullable":true},"previous_ai_manual_match_score":{"type":"number","nullable":true},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true}},"required":["id","name","count","previous_count","count_delta","average_score","previous_average_score","score_delta"]}}},"required":["total_count","previous_total_count","ai_count","previous_ai_count","manual_count","previous_manual_count","ai_score","previous_ai_score","manual_score","previous_manual_score","ai_manual_score_gap","previous_ai_manual_score_gap","ai_manual_match_score","previous_ai_manual_match_score","reviewers"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","metrics","scorecard_performance","critical_errors","contact_reasons","channels","score_distribution","child_criteria_performance","feedback_reasons","failing_check_results","agent_scores","peer_benchmark","scorecards","score_option_types","movements","peer_channel_benchmarks","peer_criterion_benchmarks","review_context"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance team lead overview unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/teams/{team_id}/overview":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"team_id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"critical_errors_limit","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"contact_reasons_limit","in":"query"}],"responses":{"200":{"description":"Performance team overview found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"metrics":{"type":"object","properties":{"subject_type":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"subject_id":{"type":"string","nullable":true},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"ai_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"manual_evaluations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"reviewed_conversations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"approved_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"resolved_tickets":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"average_handling_time":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","qa_score","ai_reviews","manual_evaluations","reviewed_conversations","approved_reviews","resolved_tickets","average_handling_time"]},"scorecard_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"critical_errors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"total_count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_rate":{"type":"number","nullable":true},"rate_delta":{"type":"number","nullable":true}},"required":["id","label","count","total_count","previous_count","count_delta","rate","previous_rate","rate_delta"]}},"contact_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","previous_score","previous_count","score_delta","count_delta"]}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"critical_error_count":{"type":"integer"},"critical_error_rate":{"type":"number","nullable":true},"criterion_pass_rate":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"previous_critical_error_count":{"type":"integer"},"previous_critical_error_rate":{"type":"number","nullable":true},"previous_criterion_pass_rate":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","high_count","medium_count","low_count","critical_error_count","critical_error_rate","criterion_pass_rate","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","previous_critical_error_count","previous_critical_error_rate","previous_criterion_pass_rate","score_delta","count_delta"]}},"score_distribution":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["high","medium","low"]},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["level","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"child_criteria_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true},"parent_id":{"type":"string"},"parent_label":{"type":"string"}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta","parent_id","parent_label"]}},"feedback_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"parent_criterion_id":{"type":"string"},"parent_criterion_label":{"type":"string"},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","label","scorecard_id","scorecard_name","parent_criterion_id","parent_criterion_label","criterion_id","criterion_label","count","previous_count","count_delta"]}},"failing_check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"check_id":{"type":"string"},"check_description":{"type":"string"},"knowledge_base_answer":{"type":"string","nullable":true},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"result":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"selected_justification_option_label":{"type":"string","nullable":true},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","check_id","check_description","knowledge_base_answer","scorecard_id","scorecard_name","criterion_id","criterion_label","result","selected_justification_option_id","selected_justification_option_label","count","previous_count","count_delta"]}},"agent_scores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","name","score","count","high_count","medium_count","low_count","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","score_delta","count_delta"]}},"peer_benchmark":{"type":"object","nullable":true,"properties":{"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"agent_score":{"type":"number","nullable":true},"agent_previous_score":{"type":"number","nullable":true},"agent_score_delta":{"type":"number","nullable":true},"agent_evaluations_count":{"type":"integer"},"team_score":{"type":"number","nullable":true},"team_previous_score":{"type":"number","nullable":true},"team_score_delta":{"type":"number","nullable":true},"team_evaluations_count":{"type":"integer"},"agent_rank":{"type":"integer","nullable":true},"ranked_agents_count":{"type":"integer"},"agents_above_count":{"type":"integer"},"agents_below_count":{"type":"integer"},"agent_percentile":{"type":"number","nullable":true}},"required":["team_id","team_name","agent_score","agent_previous_score","agent_score_delta","agent_evaluations_count","team_score","team_previous_score","team_score_delta","team_evaluations_count","agent_rank","ranked_agents_count","agents_above_count","agents_below_count","agent_percentile"]},"scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","name","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"score_option_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["type","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"movements":{"type":"object","properties":{"agents":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"criteria":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"channels":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"contact_reasons":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]}},"required":["agents","criteria","channels","contact_reasons"]},"peer_channel_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"peer_criterion_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"review_context":{"type":"object","properties":{"total_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"ai_count":{"type":"integer"},"previous_ai_count":{"type":"integer"},"manual_count":{"type":"integer"},"previous_manual_count":{"type":"integer"},"ai_score":{"type":"number","nullable":true},"previous_ai_score":{"type":"number","nullable":true},"manual_score":{"type":"number","nullable":true},"previous_manual_score":{"type":"number","nullable":true},"ai_manual_score_gap":{"type":"number","nullable":true},"previous_ai_manual_score_gap":{"type":"number","nullable":true},"ai_manual_match_score":{"type":"number","nullable":true},"previous_ai_manual_match_score":{"type":"number","nullable":true},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true}},"required":["id","name","count","previous_count","count_delta","average_score","previous_average_score","score_delta"]}}},"required":["total_count","previous_total_count","ai_count","previous_ai_count","manual_count","previous_manual_count","ai_score","previous_ai_score","manual_score","previous_manual_score","ai_manual_score_gap","previous_ai_manual_score_gap","ai_manual_match_score","previous_ai_manual_match_score","reviewers"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","metrics","scorecard_performance","critical_errors","contact_reasons","channels","score_distribution","child_criteria_performance","feedback_reasons","failing_check_results","agent_scores","peer_benchmark","scorecards","score_option_types","movements","peer_channel_benchmarks","peer_criterion_benchmarks","review_context"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance team overview unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/agents/{agent_id}/overview":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"agent_id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"critical_errors_limit","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"contact_reasons_limit","in":"query"}],"responses":{"200":{"description":"Performance agent overview found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","brand","team_lead","agent"]},"subject_id":{"type":"string"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"metrics":{"type":"object","properties":{"subject_type":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"subject_id":{"type":"string","nullable":true},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"ai_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"manual_evaluations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"reviewed_conversations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"approved_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"resolved_tickets":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"average_handling_time":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","qa_score","ai_reviews","manual_evaluations","reviewed_conversations","approved_reviews","resolved_tickets","average_handling_time"]},"scorecard_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"critical_errors":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"total_count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_rate":{"type":"number","nullable":true},"rate_delta":{"type":"number","nullable":true}},"required":["id","label","count","total_count","previous_count","count_delta","rate","previous_rate","rate_delta"]}},"contact_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","previous_score","previous_count","score_delta","count_delta"]}},"channels":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"critical_error_count":{"type":"integer"},"critical_error_rate":{"type":"number","nullable":true},"criterion_pass_rate":{"type":"number","nullable":true},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"previous_critical_error_count":{"type":"integer"},"previous_critical_error_rate":{"type":"number","nullable":true},"previous_criterion_pass_rate":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","label","score","count","high_count","medium_count","low_count","critical_error_count","critical_error_rate","criterion_pass_rate","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","previous_critical_error_count","previous_critical_error_rate","previous_criterion_pass_rate","score_delta","count_delta"]}},"score_distribution":{"type":"array","items":{"type":"object","properties":{"level":{"type":"string","enum":["high","medium","low"]},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["level","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"child_criteria_performance":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true},"parent_id":{"type":"string"},"parent_label":{"type":"string"}},"required":["id","label","scorecard_id","scorecard_name","max_score","weight","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta","parent_id","parent_label"]}},"feedback_reasons":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"parent_criterion_id":{"type":"string"},"parent_criterion_label":{"type":"string"},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","label","scorecard_id","scorecard_name","parent_criterion_id","parent_criterion_label","criterion_id","criterion_label","count","previous_count","count_delta"]}},"failing_check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"check_id":{"type":"string"},"check_description":{"type":"string"},"knowledge_base_answer":{"type":"string","nullable":true},"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"criterion_id":{"type":"string"},"criterion_label":{"type":"string"},"result":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"selected_justification_option_label":{"type":"string","nullable":true},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"}},"required":["id","check_id","check_description","knowledge_base_answer","scorecard_id","scorecard_name","criterion_id","criterion_label","result","selected_justification_option_id","selected_justification_option_label","count","previous_count","count_delta"]}},"agent_scores":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"score":{"type":"number"},"count":{"type":"integer"},"high_count":{"type":"integer"},"medium_count":{"type":"integer"},"low_count":{"type":"integer"},"previous_score":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_high_count":{"type":"integer"},"previous_medium_count":{"type":"integer"},"previous_low_count":{"type":"integer"},"score_delta":{"type":"number","nullable":true},"count_delta":{"type":"integer"}},"required":["id","name","score","count","high_count","medium_count","low_count","previous_score","previous_count","previous_high_count","previous_medium_count","previous_low_count","score_delta","count_delta"]}},"peer_benchmark":{"type":"object","nullable":true,"properties":{"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"agent_score":{"type":"number","nullable":true},"agent_previous_score":{"type":"number","nullable":true},"agent_score_delta":{"type":"number","nullable":true},"agent_evaluations_count":{"type":"integer"},"team_score":{"type":"number","nullable":true},"team_previous_score":{"type":"number","nullable":true},"team_score_delta":{"type":"number","nullable":true},"team_evaluations_count":{"type":"integer"},"agent_rank":{"type":"integer","nullable":true},"ranked_agents_count":{"type":"integer"},"agents_above_count":{"type":"integer"},"agents_below_count":{"type":"integer"},"agent_percentile":{"type":"number","nullable":true}},"required":["team_id","team_name","agent_score","agent_previous_score","agent_score_delta","agent_evaluations_count","team_score","team_previous_score","team_score_delta","team_evaluations_count","agent_rank","ranked_agents_count","agents_above_count","agents_below_count","agent_percentile"]},"scorecards":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"},"total_count":{"type":"integer"},"previous_passed_count":{"type":"integer"},"previous_partial_count":{"type":"integer"},"previous_failed_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"pass_rate":{"type":"number","nullable":true},"previous_pass_rate":{"type":"number","nullable":true},"pass_rate_delta":{"type":"number","nullable":true}},"required":["id","name","passed_count","partial_count","failed_count","total_count","previous_passed_count","previous_partial_count","previous_failed_count","previous_total_count","pass_rate","previous_pass_rate","pass_rate_delta"]}},"score_option_types":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"},"rate":{"type":"number","nullable":true},"previous_count":{"type":"integer"},"previous_rate":{"type":"number","nullable":true},"count_delta":{"type":"integer"},"rate_delta":{"type":"number","nullable":true}},"required":["type","label","count","rate","previous_count","previous_rate","count_delta","rate_delta"]}},"movements":{"type":"object","properties":{"agents":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"criteria":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"channels":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]},"contact_reasons":{"type":"object","properties":{"improving":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}},"declining":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"current_value":{"type":"number"},"previous_value":{"type":"number"},"value_delta":{"type":"number"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","current_value","previous_value","value_delta","count","previous_count","context"]}}},"required":["improving","declining"]}},"required":["agents","criteria","channels","contact_reasons"]},"peer_channel_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"peer_criterion_benchmarks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"metric":{"type":"string","enum":["qa_score","pass_rate"]},"agent_value":{"type":"number"},"team_value":{"type":"number"},"value_delta":{"type":"number"},"agent_count":{"type":"integer"},"team_count":{"type":"integer"},"context":{"type":"string","nullable":true}},"required":["id","label","metric","agent_value","team_value","value_delta","agent_count","team_count","context"]}},"review_context":{"type":"object","properties":{"total_count":{"type":"integer"},"previous_total_count":{"type":"integer"},"ai_count":{"type":"integer"},"previous_ai_count":{"type":"integer"},"manual_count":{"type":"integer"},"previous_manual_count":{"type":"integer"},"ai_score":{"type":"number","nullable":true},"previous_ai_score":{"type":"number","nullable":true},"manual_score":{"type":"number","nullable":true},"previous_manual_score":{"type":"number","nullable":true},"ai_manual_score_gap":{"type":"number","nullable":true},"previous_ai_manual_score_gap":{"type":"number","nullable":true},"ai_manual_match_score":{"type":"number","nullable":true},"previous_ai_manual_match_score":{"type":"number","nullable":true},"reviewers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"count":{"type":"integer"},"previous_count":{"type":"integer"},"count_delta":{"type":"integer"},"average_score":{"type":"number","nullable":true},"previous_average_score":{"type":"number","nullable":true},"score_delta":{"type":"number","nullable":true}},"required":["id","name","count","previous_count","count_delta","average_score","previous_average_score","score_delta"]}}},"required":["total_count","previous_total_count","ai_count","previous_ai_count","manual_count","previous_manual_count","ai_score","previous_ai_score","manual_score","previous_manual_score","ai_manual_score_gap","previous_ai_manual_score_gap","ai_manual_match_score","previous_ai_manual_match_score","reviewers"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","metrics","scorecard_performance","critical_errors","contact_reasons","channels","score_distribution","child_criteria_performance","feedback_reasons","failing_check_results","agent_scores","peer_benchmark","scorecards","score_option_types","movements","peer_channel_benchmarks","peer_criterion_benchmarks","review_context"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance agent overview unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-27d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string","enum":["name","team_count","qa_score"],"default":"qa_score"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance brands found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"teams_count":{"type":"integer"},"reviews_count":{"type":"integer"},"qa_score":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true}},"required":["id","name","teams_count","reviews_count","qa_score","previous_qa_score","qa_score_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Membership scope is not configured correctly","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance brands unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands/{brand_id}/teams":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brand_id","in":"path"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-27d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_lead_membership_id","in":"query"},{"schema":{"type":"string","enum":["name","qa_score","agent_count"],"default":"qa_score"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance brand teams found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"agents_count":{"type":"integer"},"reviews_count":{"type":"integer"},"qa_score":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true}},"required":["id","name","agents_count","reviews_count","qa_score","previous_qa_score","qa_score_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]},"summary":{"type":"object","properties":{"teams_count":{"type":"integer"},"agents_count":{"type":"integer"}},"required":["teams_count","agents_count"]}},"required":["page","summary"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance brand teams unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands/{brand_id}/team-leads":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brand_id","in":"path"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-27d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_lead_membership_id","in":"query"},{"schema":{"type":"string","enum":["name","team_count","agent_count","qa_score","high_score_rate","medium_score_rate","low_score_rate","critical_error_rate","reviews_count","coaching_count"],"default":"qa_score"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance brand team leads found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"teams_count":{"type":"integer"},"agents_count":{"type":"integer"},"reviews_count":{"type":"integer"},"coachings_count":{"type":"integer"},"qa_score":{"type":"number","nullable":true},"high_score_rate":{"type":"number","nullable":true},"medium_score_rate":{"type":"number","nullable":true},"low_score_rate":{"type":"number","nullable":true},"critical_error_rate":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true}},"required":["id","name","email","teams_count","agents_count","reviews_count","coachings_count","qa_score","high_score_rate","medium_score_rate","low_score_rate","critical_error_rate","previous_qa_score","qa_score_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance brand team leads unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/brands/{brand_id}/metric-history":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"brand_id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","enum":["team","team_lead"],"default":"team_lead"},"required":false,"name":"compare_by","in":"query"}],"responses":{"200":{"description":"Brand metric history found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"subject_id":{"type":"string"},"subject_name":{"type":"string"},"week_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"week_end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"number","nullable":true},"high_score_rate":{"type":"number","nullable":true},"medium_score_rate":{"type":"number","nullable":true},"low_score_rate":{"type":"number","nullable":true},"critical_error_rate":{"type":"number","nullable":true},"evaluations_count":{"type":"integer"},"ai_evaluations_count":{"type":"integer"},"manual_evaluations_count":{"type":"integer"},"ai_qa_score":{"type":"number","nullable":true},"manual_qa_score":{"type":"number","nullable":true},"manual_ai_score_delta":{"type":"number","nullable":true},"coachings_count":{"type":"integer"}},"required":["subject_id","subject_name","week_start","week_end","qa_score","high_score_rate","medium_score_rate","low_score_rate","critical_error_rate","evaluations_count","ai_evaluations_count","manual_evaluations_count","ai_qa_score","manual_qa_score","manual_ai_score_delta","coachings_count"]}},"meta":{"type":"object","properties":{"compare_by":{"type":"string","enum":["team","team_lead"]},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["compare_by","start_date","end_date"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance brand metric history unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/teams":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-27d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_lead_membership_id","in":"query"},{"schema":{"type":"string","enum":["all","mine"],"default":"all"},"required":false,"name":"scope","in":"query"},{"schema":{"type":"string","enum":["name","agent_count","qa_score"],"default":"qa_score"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance teams found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"team_lead_membership":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]},"team_lead_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","account"]}},"agents_count":{"type":"integer"},"reviews_count":{"type":"integer"},"qa_score":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true}},"required":["id","name","team_lead_membership","team_lead_memberships","agents_count","reviews_count","qa_score","previous_qa_score","qa_score_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Membership scope is not configured correctly","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance teams unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/team-leads":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance team leads found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Membership scope is not configured correctly","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance team leads unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/teams/{team_id}/agents":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"team_id","in":"path"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-30d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_role","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0,"maximum":1},"required":false,"name":"qa_score_lt","in":"query"},{"schema":{"type":"string","enum":["all","mine"],"default":"all"},"required":false,"name":"scope","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance team agents found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true},"reviews_count":{"type":"integer"},"previous_reviews_count":{"type":"integer"},"reviews_count_delta":{"type":"integer"}},"required":["id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","team_id","team_name","evaluable","created_at","updated_at","qa_score","previous_qa_score","qa_score_delta","reviews_count","previous_reviews_count","reviews_count_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance team agents unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/agents":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"-30d"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^(\\d{4}-\\d{2}-\\d{2}|-?\\d+[hdwMy]|-\\d+[hdwMy]_(start|end)|(start|end)_of_(day|week|month|year))$","default":"0d"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_role","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0,"maximum":1},"required":false,"name":"qa_score_lt","in":"query"},{"schema":{"type":"string","enum":["all","mine"],"default":"all"},"required":false,"name":"scope","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"},{"schema":{"type":"string","pattern":"^\\d+$","default":"1"},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Performance agents found across accessible teams","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"team_id":{"type":"string"},"team_name":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"qa_score":{"type":"number","nullable":true},"previous_qa_score":{"type":"number","nullable":true},"qa_score_delta":{"type":"number","nullable":true},"reviews_count":{"type":"integer"},"previous_reviews_count":{"type":"integer"},"reviews_count_delta":{"type":"integer"}},"required":["id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","team_id","team_name","evaluable","created_at","updated_at","qa_score","previous_qa_score","qa_score_delta","reviews_count","previous_reviews_count","reviews_count_delta"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance agents unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/reviewers":{"get":{"parameters":[{"schema":{"type":"string","enum":["team","agent"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subject_id","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Performance reviewers found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"review_count":{"type":"integer"}},"required":["id","name","email","review_count"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance reviewers unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/metric-trend":{"get":{"parameters":[{"schema":{"type":"string","enum":["team","agent","brand","team_lead"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subject_id","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"integer","minimum":2,"maximum":24,"default":10},"required":false,"name":"periods","in":"query"}],"responses":{"200":{"description":"Performance metric trend found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"evaluations_count":{"type":"integer"},"reviewed_conversations_count":{"type":"integer"}},"required":["start_date","end_date","evaluations_count","reviewed_conversations_count"]}},"meta":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","agent","brand","team_lead"]},"subject_id":{"type":"string"},"period_days":{"type":"integer"},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["subject_type","subject_id","period_days","start_date","end_date"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance metric trend unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/metrics":{"get":{"parameters":[{"schema":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"subject_id","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_start_date","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previous_end_date","in":"query"}],"responses":{"200":{"description":"Performance metrics found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"subject_type":{"type":"string","enum":["organization","team","brand","team_lead","agent"]},"subject_id":{"type":"string","nullable":true},"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_start_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"previous_end_date":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"qa_score":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"ai_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"manual_evaluations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"reviewed_conversations":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"approved_reviews":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"resolved_tickets":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]},"average_handling_time":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previous_value":{"type":"number","nullable":true},"absolute_delta":{"type":"number","nullable":true},"relative_delta":{"type":"number","nullable":true}},"required":["value","previous_value","absolute_delta","relative_delta"]}},"required":["subject_type","subject_id","start_date","end_date","previous_start_date","previous_end_date","qa_score","ai_reviews","manual_evaluations","reviewed_conversations","approved_reviews","resolved_tickets","average_handling_time"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance metrics unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/targets":{"get":{"tags":["Performance"],"summary":"List performance targets for a subject","operationId":"listPerformanceTargets","parameters":[{"schema":{"type":"string","enum":["team","agent","brand"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subject_id","in":"query"}],"responses":{"200":{"description":"Performance targets for the subject","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string"},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true},"metric_label":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["on_track","behind","holding","met","missed","insufficient_data","no_data","scheduled"]},"current":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"change_since_baseline":{"type":"number","nullable":true},"gap_to_target":{"type":"number","nullable":true},"is_floor":{"type":"boolean"},"scheduled_revision":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_to":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"created_at":{"type":"string"}},"required":["id","target_value","minimum_sample_size","effective_from","effective_to","baseline","created_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","today","subject_type","subject_id","metric_type","scorecard_criterion_id","metric_label","target_value","minimum_sample_size","effective_from","target_date","status","current","baseline","change_since_baseline","gap_to_target","is_floor","scheduled_revision","created_at","updated_at"]}},"meta":{"type":"object","properties":{"can_manage":{"type":"boolean"}},"required":["can_manage"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"tags":["Performance"],"summary":"Create a performance target","operationId":"createPerformanceTarget","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string","minLength":1},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true,"minLength":1},"target_value":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["subject_type","subject_id","metric_type","target_value"]}}}},"responses":{"201":{"description":"Created performance target","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string"},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true},"metric_label":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["on_track","behind","holding","met","missed","insufficient_data","no_data","scheduled"]},"current":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"change_since_baseline":{"type":"number","nullable":true},"gap_to_target":{"type":"number","nullable":true},"is_floor":{"type":"boolean"},"scheduled_revision":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_to":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"created_at":{"type":"string"}},"required":["id","target_value","minimum_sample_size","effective_from","effective_to","baseline","created_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","today","subject_type","subject_id","metric_type","scorecard_criterion_id","metric_label","target_value","minimum_sample_size","effective_from","target_date","status","current","baseline","change_since_baseline","gap_to_target","is_floor","scheduled_revision","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/targets/preview":{"get":{"tags":["Performance"],"summary":"Preview completed-week history and frozen baseline for a metric","operationId":"getPerformanceTargetPreview","parameters":[{"schema":{"type":"string","enum":["team","agent","brand"]},"required":true,"name":"subject_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"subject_id","in":"query"},{"schema":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"required":true,"name":"metric_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"scorecard_criterion_id","in":"query"},{"schema":{"type":"integer","minimum":4,"maximum":52,"default":8},"required":false,"name":"weeks","in":"query"}],"responses":{"200":{"description":"Target preview for the subject and metric","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string"},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true},"metric_label":{"type":"string"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"weekly_series":{"type":"array","items":{"type":"object","properties":{"week_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"week_end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"target_value":{"type":"number","nullable":true}},"required":["week_start","week_end","value","sample_size","target_value"]}},"existing_target":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"target_value":{"type":"number"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"is_scheduled":{"type":"boolean"}},"required":["id","target_value","effective_from","target_date","is_scheduled"]}},"required":["today","subject_type","subject_id","metric_type","scorecard_criterion_id","metric_label","baseline","weekly_series","existing_target"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/targets/{target_id}":{"get":{"tags":["Performance"],"summary":"Get a performance target with weekly history","operationId":"getPerformanceTarget","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"target_id","in":"path"},{"schema":{"type":"integer","minimum":4,"maximum":52,"default":12},"required":false,"name":"weeks","in":"query"}],"responses":{"200":{"description":"Performance target detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string"},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true},"metric_label":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["on_track","behind","holding","met","missed","insufficient_data","no_data","scheduled"]},"current":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"change_since_baseline":{"type":"number","nullable":true},"gap_to_target":{"type":"number","nullable":true},"is_floor":{"type":"boolean"},"scheduled_revision":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_to":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"created_at":{"type":"string"}},"required":["id","target_value","minimum_sample_size","effective_from","effective_to","baseline","created_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"weekly_series":{"type":"array","items":{"type":"object","properties":{"week_start":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"week_end":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"target_value":{"type":"number","nullable":true}},"required":["week_start","week_end","value","sample_size","target_value"]}},"revisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_to":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"created_at":{"type":"string"}},"required":["id","target_value","minimum_sample_size","effective_from","effective_to","baseline","created_at"]}}},"required":["id","today","subject_type","subject_id","metric_type","scorecard_criterion_id","metric_label","target_value","minimum_sample_size","effective_from","target_date","status","current","baseline","change_since_baseline","gap_to_target","is_floor","scheduled_revision","created_at","updated_at","weekly_series","revisions"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"tags":["Performance"],"summary":"Archive a performance target","operationId":"archivePerformanceTarget","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"target_id","in":"path"}],"responses":{"200":{"description":"Archived performance target","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"archived":{"type":"boolean","enum":[true]}},"required":["archived"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/performance/targets/{target_id}/revisions":{"post":{"tags":["Performance"],"summary":"Revise a performance target threshold","operationId":"createPerformanceTargetRevision","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"target_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"target_value":{"type":"number","minimum":0,"exclusiveMinimum":true,"maximum":1},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["target_value"]}}}},"responses":{"201":{"description":"Performance target with the appended revision","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"today":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"subject_type":{"type":"string","enum":["team","agent","brand"]},"subject_id":{"type":"string"},"metric_type":{"type":"string","enum":["overall_qa_score","criterion_pass_rate"]},"scorecard_criterion_id":{"type":"string","nullable":true},"metric_label":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"target_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"status":{"type":"string","enum":["on_track","behind","holding","met","missed","insufficient_data","no_data","scheduled"]},"current":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"change_since_baseline":{"type":"number","nullable":true},"gap_to_target":{"type":"number","nullable":true},"is_floor":{"type":"boolean"},"scheduled_revision":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"target_value":{"type":"number"},"minimum_sample_size":{"type":"integer"},"effective_from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"effective_to":{"type":"string","nullable":true,"pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"baseline":{"type":"object","properties":{"value":{"type":"number","nullable":true},"sample_size":{"type":"integer"},"window":{"type":"object","properties":{"start_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"end_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["start_date","end_date"]}},"required":["value","sample_size","window"]},"created_at":{"type":"string"}},"required":["id","target_value","minimum_sample_size","effective_from","effective_to","baseline","created_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","today","subject_type","subject_id","metric_type","scorecard_criterion_id","metric_label","target_value","minimum_sample_size","effective_from","target_date","status","current","baseline","change_since_baseline","gap_to_target","is_floor","scheduled_revision","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conflicting target or revision","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Performance targets unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/views":{"get":{"parameters":[{"schema":{"type":"string","enum":["quality_assurance","customers","analytics","agent_monitoring"]},"required":false,"name":"category","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"team_id","in":"query"}],"responses":{"200":{"description":"List visible app views","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"name":{"type":"string"},"category":{"type":"string","enum":["quality_assurance","customers","analytics","agent_monitoring"]},"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"visibility":{"type":"string","enum":["private","organization"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"seededKey":{"type":"string","nullable":true},"teamId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","name","category","type","visibility","position","seededKey","teamId","createdAt","updatedAt","canEdit"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"name":{"type":"string","minLength":1,"maxLength":255},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"visibility":{"type":"string","enum":["private","organization"]},"position":{"type":"string","minLength":1},"teamId":{"type":"string","minLength":1}},"required":["type"]}}}},"responses":{"201":{"description":"App view created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"name":{"type":"string"},"category":{"type":"string","enum":["quality_assurance","customers","analytics","agent_monitoring"]},"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"visibility":{"type":"string","enum":["private","organization"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"seededKey":{"type":"string","nullable":true},"teamId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","name","category","type","visibility","position","seededKey","teamId","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"400":{"description":"Invalid app view","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/views/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"App view found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"name":{"type":"string"},"category":{"type":"string","enum":["quality_assurance","customers","analytics","agent_monitoring"]},"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"visibility":{"type":"string","enum":["private","organization"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"seededKey":{"type":"string","nullable":true},"teamId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","name","category","type","visibility","position","seededKey","teamId","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"404":{"description":"App view not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"visibility":{"type":"string","enum":["private","organization"]},"position":{"type":"string","minLength":1}}}}}},"responses":{"200":{"description":"App view updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"name":{"type":"string"},"category":{"type":"string","enum":["quality_assurance","customers","analytics","agent_monitoring"]},"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"visibility":{"type":"string","enum":["private","organization"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"seededKey":{"type":"string","nullable":true},"teamId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","name","category","type","visibility","position","seededKey","teamId","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"400":{"description":"Invalid app view","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"App view not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"App view deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"App view not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/views/suggest-name":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","enum":["qa_interactions","qa_evaluations","qa_complaints","qa_evaluation_contests","customers","work_items","dashboard_filters","customer_complaints","agent_issues","agent_capabilities"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"filterLabels":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["key","label"]}}},"required":["type"]}}}},"responses":{"200":{"description":"Suggested name for a stored app view","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":64}},"required":["name"]}},"required":["data"]}}}},"400":{"description":"Invalid app view filters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-schedules":{"get":{"responses":{"200":{"description":"List visible recurring exports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","exportType","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt","lastRunAt","createdAt","updatedAt","canEdit"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"],"default":"weekly"},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["exportType","dayOfWeek","timeOfDay","recipients"]}}}},"responses":{"201":{"description":"Recurring export created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","exportType","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt","lastRunAt","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"400":{"description":"Invalid recurring export","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-schedules/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Recurring export found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","exportType","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt","lastRunAt","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Recurring export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1}}}}}},"responses":{"200":{"description":"Recurring export updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","exportType","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt","lastRunAt","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"400":{"description":"Invalid recurring export","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Recurring export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Recurring export deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Recurring export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-schedules/preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]}},"required":["exportType"]}}}},"responses":{"200":{"description":"Recurring export preview","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"headers":{"type":"array","items":{"type":"string"}},"headerRows":{"type":"array","items":{"type":"array","items":{"type":"string"}}},"rows":{"type":"array","items":{"type":"array","items":{"type":"string"}}}},"required":["headers","rows"]}},"required":["data"]}}}},"400":{"description":"Invalid recurring export preview","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-schedules/{id}/send":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Recurring export enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"createdByMembershipId":{"type":"string","nullable":true},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"frequency":{"type":"string","enum":["daily","weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string"},"minItems":1},"nextRunAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"canEdit":{"type":"boolean"}},"required":["id","organizationId","createdByMembershipId","exportType","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt","lastRunAt","createdAt","updatedAt","canEdit"]}},"required":["data"]}}}},"400":{"description":"Recurring export cannot be sent","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Recurring export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-runs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"fieldKeys":{"type":"array","items":{"type":"string"},"default":[]},"delivery":{"type":"string","enum":["download","email"]}},"required":["exportType"]}}}},"responses":{"202":{"description":"Export queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string"},"exportRun":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"exportScheduleId":{"type":"string","nullable":true},"requestedByMembershipId":{"type":"string","nullable":true},"requestedBy":{"type":"object","nullable":true,"properties":{"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["name","email"]},"source":{"type":"string","enum":["manual","scheduled"]},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true}},"fieldKeys":{"type":"array","items":{"type":"string"}},"recipients":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"requestedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"emailedAt":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"attachment":{"type":"object","nullable":true,"properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"fileSizeBytes":{"type":"number","nullable":true},"downloadUrl":{"type":"string"}},"required":["filename","contentType","fileSizeBytes","downloadUrl"]},"emailResults":{"type":"array","items":{"type":"object","properties":{"recipient":{"type":"string"},"ok":{"type":"boolean"},"providerMessageId":{"type":"string"},"error":{"type":"string"}},"required":["recipient","ok"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","exportScheduleId","requestedByMembershipId","requestedBy","source","exportType","filters","fieldKeys","recipients","status","requestedAt","startedAt","completedAt","emailedAt","errorMessage","attachment","emailResults","createdAt","updatedAt"]}},"required":["message","exportRun"]}},"required":["data"]}}}},"400":{"description":"Invalid export request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"scheduleId","in":"query"}],"responses":{"200":{"description":"List export runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"exportScheduleId":{"type":"string","nullable":true},"requestedByMembershipId":{"type":"string","nullable":true},"requestedBy":{"type":"object","nullable":true,"properties":{"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["name","email"]},"source":{"type":"string","enum":["manual","scheduled"]},"exportType":{"type":"string","enum":["qa_tickets","qa_evaluations","all_interactions","work_items","complaints","coaching_sessions"]},"filters":{"type":"object","additionalProperties":{"nullable":true}},"fieldKeys":{"type":"array","items":{"type":"string"}},"recipients":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["queued","running","succeeded","failed"]},"requestedAt":{"type":"string"},"startedAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"emailedAt":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"attachment":{"type":"object","nullable":true,"properties":{"filename":{"type":"string"},"contentType":{"type":"string"},"fileSizeBytes":{"type":"number","nullable":true},"downloadUrl":{"type":"string"}},"required":["filename","contentType","fileSizeBytes","downloadUrl"]},"emailResults":{"type":"array","items":{"type":"object","properties":{"recipient":{"type":"string"},"ok":{"type":"boolean"},"providerMessageId":{"type":"string"},"error":{"type":"string"}},"required":["recipient","ok"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","exportScheduleId","requestedByMembershipId","requestedBy","source","exportType","filters","fieldKeys","recipients","status","requestedAt","startedAt","completedAt","emailedAt","errorMessage","attachment","emailResults","createdAt","updatedAt"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-runs/{id}/download":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Export attachment","content":{"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Export run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Export run has no completed attachment","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/export-runs/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Export run deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Export run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports":{"get":{"responses":{"200":{"description":"Configured cloud storage exports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bucketName":{"type":"string","minLength":3,"maxLength":63},"region":{"type":"string","minLength":1},"prefix":{"type":"string","maxLength":1024,"default":""},"accessKeyId":{"type":"string","minLength":16,"maxLength":128},"secretAccessKey":{"type":"string","minLength":16,"maxLength":128}},"required":["bucketName","region","accessKeyId","secretAccessKey"]}}}},"responses":{"201":{"description":"Created a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid credentials or S3 write failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/{id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bucketName":{"type":"string","minLength":3,"maxLength":63},"region":{"type":"string","minLength":1},"prefix":{"type":"string","maxLength":1024,"default":""},"accessKeyId":{"type":"string","minLength":16,"maxLength":128},"secretAccessKey":{"type":"string","minLength":16,"maxLength":128}},"required":["bucketName","region","accessKeyId","secretAccessKey"]}}}},"responses":{"200":{"description":"Updated a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid credentials or S3 write failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/{id}/pause":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Paused a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/{id}/resume":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Resumed a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/{id}/runs":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Recent runs for a cloud storage export","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["manual","scheduled"]},"status":{"type":"string","enum":["running","succeeded","failed"]},"bucket":{"type":"string","nullable":true},"objectKey":{"type":"string","nullable":true},"rowCount":{"type":"integer","nullable":true},"evaluatedAfter":{"type":"string","nullable":true},"evaluatedBefore":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"completedAt":{"type":"string","nullable":true}},"required":["id","source","status","bucket","objectKey","rowCount","evaluatedAfter","evaluatedBefore","errorMessage","startedAt","completedAt"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/{id}/run":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Ran a cloud storage export now","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"export":{"type":"object","properties":{"id":{"type":"string"},"destination":{"type":"string","enum":["aws_s3"]},"exportType":{"type":"string","enum":["qa_evaluations"]},"bucketName":{"type":"string"},"region":{"type":"string"},"prefix":{"type":"string"},"accessKeyId":{"type":"string"},"hasSecretAccessKey":{"type":"boolean","enum":[true]},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"status":{"type":"string","enum":["active","paused","failed"]},"lastError":{"type":"string","nullable":true},"lastTestedAt":{"type":"string","nullable":true},"lastRunAt":{"type":"string","nullable":true},"nextRunAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","destination","exportType","bucketName","region","prefix","accessKeyId","hasSecretAccessKey","frequency","dayOfWeek","timeOfDay","timezone","status","lastError","lastTestedAt","lastRunAt","nextRunAt","createdAt","updatedAt"]},"run":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["manual","scheduled"]},"status":{"type":"string","enum":["running","succeeded","failed"]},"bucket":{"type":"string","nullable":true},"objectKey":{"type":"string","nullable":true},"rowCount":{"type":"integer","nullable":true},"evaluatedAfter":{"type":"string","nullable":true},"evaluatedBefore":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"completedAt":{"type":"string","nullable":true}},"required":["id","source","status","bucket","objectKey","rowCount","evaluatedAfter","evaluatedBefore","errorMessage","startedAt","completedAt"]}},"required":["export","run"]}},"required":["data"]}}}},"400":{"description":"Export failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/cloud-storage-exports/test":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"bucketName":{"type":"string","minLength":3,"maxLength":63},"region":{"type":"string","minLength":1},"prefix":{"type":"string","maxLength":1024,"default":""},"accessKeyId":{"type":"string","minLength":16,"maxLength":128},"secretAccessKey":{"type":"string","minLength":16,"maxLength":128}},"required":["bucketName","region","accessKeyId","secretAccessKey"]}}}},"responses":{"200":{"description":"Wrote a test object to the customer S3 bucket","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"bucket":{"type":"string"},"key":{"type":"string"}},"required":["ok","bucket","key"]}},"required":["data"]}}}},"400":{"description":"Invalid credentials or S3 write failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_evaluation_requests":{"get":{"parameters":[{"schema":{"type":"string","enum":["me"]},"required":false,"name":"requested_by","in":"query"},{"schema":{"type":"string","enum":["user_requested"]},"required":false,"name":"trigger_type","in":"query"},{"schema":{"type":"string","enum":["queued","completed","failed"]},"required":false,"name":"status_group","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Current member requested evaluation requests","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"groups":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string","enum":["queued","completed","failed"]},"count":{"type":"integer"},"requests":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"status_group":{"type":"string"},"trigger_type":{"type":"string"},"skip_reason":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true}},"required":["id","name","email","phone"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","phone","type","avatar_url"]}}},"required":["id","external_id","subject","summary","requester","agents"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true}},"required":["id","status","status_group","trigger_type","skip_reason","error_message","qa_evaluation_id","conversation","created_at","updated_at","completed_at"]}}},"required":["status","count","requests"]}}},"required":["groups"]}},"required":["data"]}}}},"404":{"description":"Organization or membership not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_request_imports/template":{"get":{"responses":{"200":{"description":"CSV template","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/evaluation_request_imports":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Current member evaluation request imports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"imports":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"import_type":{"type":"string"},"ticket_id":{"type":"string","nullable":true},"ticket_ids":{"type":"array","items":{"type":"string"}},"ticket_count":{"type":"integer"},"completed_count":{"type":"integer"},"percent_complete":{"type":"integer"},"team":{"type":"object","nullable":true,"properties":{"id":{"type":"number"},"name":{"type":"string"}},"required":["id","name"]},"agent_names":{"type":"array","items":{"type":"string"}},"tickets_per_agent":{"type":"integer","nullable":true},"resolved_after":{"type":"string","nullable":true},"resolved_before":{"type":"string","nullable":true},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","import_type","ticket_id","ticket_ids","ticket_count","completed_count","percent_complete","team","agent_names","tickets_per_agent","resolved_after","resolved_before","agent_coverage_summary","conversation_id","conversation_subject","error_message","created_at","updated_at"]}}},"required":["imports"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true},"date_attribution":{"type":"string","enum":["ticket_closed","today"],"default":"ticket_closed"}}}}}},"responses":{"201":{"description":"Import created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"import_type":{"type":"string"},"status":{"type":"string"},"source_filename":{"type":"string","nullable":true},"selection_config":{"type":"object","nullable":true,"properties":{"employeeIds":{"type":"array","items":{"type":"string"}},"ticketsPerAgent":{"type":"integer"},"resolvedAfter":{"type":"string"},"resolvedBefore":{"type":"string"}},"required":["employeeIds","ticketsPerAgent","resolvedAfter","resolvedBefore"]},"date_attribution":{"type":"string","enum":["ticket_closed","today"]},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"total_rows":{"type":"integer"},"ready_rows":{"type":"integer"},"blocked_rows":{"type":"integer"},"removed_rows":{"type":"integer"},"submitted_rows":{"type":"integer"},"error_message":{"type":"string","nullable":true},"can_submit":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"submitted_at":{"type":"string","nullable":true},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"integer"},"ticket_id":{"type":"string"},"status":{"type":"string","enum":["pending","found","importing","imported","not_found","already_queued","already_evaluated","import_failed","ready","submitted","request_pending","request_ready","request_processing","request_completed","request_skipped","request_failed","request_cancelled","removed"]},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"already_evaluated":{"type":"boolean"},"already_queued":{"type":"boolean"},"existing_qa_evaluation_request_id":{"type":"string","nullable":true},"submitted_qa_evaluation_request_id":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"employee_name":{"type":"string","nullable":true},"progress_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true}},"required":["id","row_number","ticket_id","status","conversation_id","conversation_subject","already_evaluated","already_queued","existing_qa_evaluation_request_id","submitted_qa_evaluation_request_id","employee_id","employee_name","progress_message","error_message","removed_at"]}}},"required":["id","import_type","status","source_filename","selection_config","date_attribution","agent_coverage_summary","total_rows","ready_rows","blocked_rows","removed_rows","submitted_rows","error_message","can_submit","created_at","updated_at","completed_at","submitted_at","rows"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid CSV","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_request_imports/agent_selection":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"employee_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"tickets_per_agent":{"type":"integer","minimum":1,"maximum":100},"resolved_after":{"type":"string","format":"date"},"resolved_before":{"type":"string","format":"date"},"date_attribution":{"type":"string","enum":["ticket_closed","today"],"default":"ticket_closed"}},"required":["employee_ids","tickets_per_agent","resolved_after","resolved_before"]}}}},"responses":{"201":{"description":"Agent selection import created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"import_type":{"type":"string"},"status":{"type":"string"},"source_filename":{"type":"string","nullable":true},"selection_config":{"type":"object","nullable":true,"properties":{"employeeIds":{"type":"array","items":{"type":"string"}},"ticketsPerAgent":{"type":"integer"},"resolvedAfter":{"type":"string"},"resolvedBefore":{"type":"string"}},"required":["employeeIds","ticketsPerAgent","resolvedAfter","resolvedBefore"]},"date_attribution":{"type":"string","enum":["ticket_closed","today"]},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"total_rows":{"type":"integer"},"ready_rows":{"type":"integer"},"blocked_rows":{"type":"integer"},"removed_rows":{"type":"integer"},"submitted_rows":{"type":"integer"},"error_message":{"type":"string","nullable":true},"can_submit":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"submitted_at":{"type":"string","nullable":true},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"integer"},"ticket_id":{"type":"string"},"status":{"type":"string","enum":["pending","found","importing","imported","not_found","already_queued","already_evaluated","import_failed","ready","submitted","request_pending","request_ready","request_processing","request_completed","request_skipped","request_failed","request_cancelled","removed"]},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"already_evaluated":{"type":"boolean"},"already_queued":{"type":"boolean"},"existing_qa_evaluation_request_id":{"type":"string","nullable":true},"submitted_qa_evaluation_request_id":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"employee_name":{"type":"string","nullable":true},"progress_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true}},"required":["id","row_number","ticket_id","status","conversation_id","conversation_subject","already_evaluated","already_queued","existing_qa_evaluation_request_id","submitted_qa_evaluation_request_id","employee_id","employee_name","progress_message","error_message","removed_at"]}}},"required":["id","import_type","status","source_filename","selection_config","date_attribution","agent_coverage_summary","total_rows","ready_rows","blocked_rows","removed_rows","submitted_rows","error_message","can_submit","created_at","updated_at","completed_at","submitted_at","rows"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid selection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_request_imports/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Import status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"import_type":{"type":"string"},"status":{"type":"string"},"source_filename":{"type":"string","nullable":true},"selection_config":{"type":"object","nullable":true,"properties":{"employeeIds":{"type":"array","items":{"type":"string"}},"ticketsPerAgent":{"type":"integer"},"resolvedAfter":{"type":"string"},"resolvedBefore":{"type":"string"}},"required":["employeeIds","ticketsPerAgent","resolvedAfter","resolvedBefore"]},"date_attribution":{"type":"string","enum":["ticket_closed","today"]},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"total_rows":{"type":"integer"},"ready_rows":{"type":"integer"},"blocked_rows":{"type":"integer"},"removed_rows":{"type":"integer"},"submitted_rows":{"type":"integer"},"error_message":{"type":"string","nullable":true},"can_submit":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"submitted_at":{"type":"string","nullable":true},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"integer"},"ticket_id":{"type":"string"},"status":{"type":"string","enum":["pending","found","importing","imported","not_found","already_queued","already_evaluated","import_failed","ready","submitted","request_pending","request_ready","request_processing","request_completed","request_skipped","request_failed","request_cancelled","removed"]},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"already_evaluated":{"type":"boolean"},"already_queued":{"type":"boolean"},"existing_qa_evaluation_request_id":{"type":"string","nullable":true},"submitted_qa_evaluation_request_id":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"employee_name":{"type":"string","nullable":true},"progress_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true}},"required":["id","row_number","ticket_id","status","conversation_id","conversation_subject","already_evaluated","already_queued","existing_qa_evaluation_request_id","submitted_qa_evaluation_request_id","employee_id","employee_name","progress_message","error_message","removed_at"]}}},"required":["id","import_type","status","source_filename","selection_config","date_attribution","agent_coverage_summary","total_rows","ready_rows","blocked_rows","removed_rows","submitted_rows","error_message","can_submit","created_at","updated_at","completed_at","submitted_at","rows"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_request_import_rows/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Row removed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"import_type":{"type":"string"},"status":{"type":"string"},"source_filename":{"type":"string","nullable":true},"selection_config":{"type":"object","nullable":true,"properties":{"employeeIds":{"type":"array","items":{"type":"string"}},"ticketsPerAgent":{"type":"integer"},"resolvedAfter":{"type":"string"},"resolvedBefore":{"type":"string"}},"required":["employeeIds","ticketsPerAgent","resolvedAfter","resolvedBefore"]},"date_attribution":{"type":"string","enum":["ticket_closed","today"]},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"total_rows":{"type":"integer"},"ready_rows":{"type":"integer"},"blocked_rows":{"type":"integer"},"removed_rows":{"type":"integer"},"submitted_rows":{"type":"integer"},"error_message":{"type":"string","nullable":true},"can_submit":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"submitted_at":{"type":"string","nullable":true},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"integer"},"ticket_id":{"type":"string"},"status":{"type":"string","enum":["pending","found","importing","imported","not_found","already_queued","already_evaluated","import_failed","ready","submitted","request_pending","request_ready","request_processing","request_completed","request_skipped","request_failed","request_cancelled","removed"]},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"already_evaluated":{"type":"boolean"},"already_queued":{"type":"boolean"},"existing_qa_evaluation_request_id":{"type":"string","nullable":true},"submitted_qa_evaluation_request_id":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"employee_name":{"type":"string","nullable":true},"progress_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true}},"required":["id","row_number","ticket_id","status","conversation_id","conversation_subject","already_evaluated","already_queued","existing_qa_evaluation_request_id","submitted_qa_evaluation_request_id","employee_id","employee_name","progress_message","error_message","removed_at"]}}},"required":["id","import_type","status","source_filename","selection_config","date_attribution","agent_coverage_summary","total_rows","ready_rows","blocked_rows","removed_rows","submitted_rows","error_message","can_submit","created_at","updated_at","completed_at","submitted_at","rows"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_request_imports/{id}/submit":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Import submitted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"import_type":{"type":"string"},"status":{"type":"string"},"source_filename":{"type":"string","nullable":true},"selection_config":{"type":"object","nullable":true,"properties":{"employeeIds":{"type":"array","items":{"type":"string"}},"ticketsPerAgent":{"type":"integer"},"resolvedAfter":{"type":"string"},"resolvedBefore":{"type":"string"}},"required":["employeeIds","ticketsPerAgent","resolvedAfter","resolvedBefore"]},"date_attribution":{"type":"string","enum":["ticket_closed","today"]},"agent_coverage_summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"employee_id":{"type":"string"},"employee_name":{"type":"string","nullable":true},"requested":{"type":"integer"},"source_in_rulebase":{"type":"integer"},"selected":{"type":"integer"},"exclusions":{"type":"array","items":{"type":"object","properties":{"reason":{"type":"string"},"label":{"type":"string"},"count":{"type":"integer"}},"required":["reason","label","count"]}},"samples":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string"},"external_id":{"type":"string","nullable":true},"reason":{"type":"string"},"label":{"type":"string"},"detail":{"type":"string","nullable":true}},"required":["conversation_id","external_id","reason","label","detail"]}}},"required":["employee_id","employee_name","requested","source_in_rulebase","selected","exclusions","samples"]}},"total_rows":{"type":"integer"},"ready_rows":{"type":"integer"},"blocked_rows":{"type":"integer"},"removed_rows":{"type":"integer"},"submitted_rows":{"type":"integer"},"error_message":{"type":"string","nullable":true},"can_submit":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"submitted_at":{"type":"string","nullable":true},"rows":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"integer"},"ticket_id":{"type":"string"},"status":{"type":"string","enum":["pending","found","importing","imported","not_found","already_queued","already_evaluated","import_failed","ready","submitted","request_pending","request_ready","request_processing","request_completed","request_skipped","request_failed","request_cancelled","removed"]},"conversation_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"already_evaluated":{"type":"boolean"},"already_queued":{"type":"boolean"},"existing_qa_evaluation_request_id":{"type":"string","nullable":true},"submitted_qa_evaluation_request_id":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"employee_name":{"type":"string","nullable":true},"progress_message":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"removed_at":{"type":"string","nullable":true}},"required":["id","row_number","ticket_id","status","conversation_id","conversation_subject","already_evaluated","already_queued","existing_qa_evaluation_request_id","submitted_qa_evaluation_request_id","employee_id","employee_name","progress_message","error_message","removed_at"]}}},"required":["id","import_type","status","source_filename","selection_config","date_attribution","agent_coverage_summary","total_rows","ready_rows","blocked_rows","removed_rows","submitted_rows","error_message","can_submit","created_at","updated_at","completed_at","submitted_at","rows"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Not ready","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_re_evaluation_runs/criteria":{"get":{"responses":{"200":{"description":"Scorecard criteria available for re-evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"scorecards":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"has_auto_fail":{"type":"boolean"},"has_fail":{"type":"boolean"},"has_partial":{"type":"boolean"}},"required":["id","name","has_auto_fail","has_fail","has_partial"]}}},"required":["scorecard_id","scorecard_name","criteria"]}}},"required":["scorecards"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_re_evaluation_runs/preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selection_mode":{"type":"string","enum":["conditions","tickets"],"default":"conditions"},"evaluated_after":{"type":"string","format":"date-time"},"evaluated_before":{"type":"string","format":"date-time"},"condition_type":{"type":"string","enum":["auto_failed_criteria","failed_criteria","partial_criteria"],"default":"auto_failed_criteria"},"condition_criterion_ids":{"type":"array","items":{"type":"string"},"maxItems":100,"default":[]},"conversation_ids":{"type":"array","items":{"type":"string"},"maxItems":500,"default":[]},"target_criterion_ids":{"type":"array","items":{"type":"string"},"maxItems":100}},"required":["target_criterion_ids"]}}}},"responses":{"200":{"description":"Preview","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"matching_evaluations":{"type":"integer"},"matching_tickets":{"type":"integer"},"re_evaluable_evaluations":{"type":"integer"},"by_scorecard":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string"},"scorecard_name":{"type":"string","nullable":true},"evaluations":{"type":"integer"}},"required":["scorecard_id","scorecard_name","evaluations"]}},"sample":{"type":"array","items":{"type":"object","properties":{"qa_agent_evaluation_id":{"type":"string"},"conversation_prefix_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"subject_employee_name":{"type":"string","nullable":true},"criteria":{"type":"array","items":{"type":"object","properties":{"criterion_id":{"type":"string"},"score_option_label":{"type":"string","nullable":true},"score":{"type":"number","nullable":true}},"required":["criterion_id","score_option_label","score"]}}},"required":["qa_agent_evaluation_id","conversation_prefix_id","conversation_external_id","subject_employee_name","criteria"]}}},"required":["matching_evaluations","matching_tickets","re_evaluable_evaluations","by_scorecard","sample"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid selection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_re_evaluation_runs":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"selection_mode":{"type":"string","enum":["conditions","tickets"],"default":"conditions"},"evaluated_after":{"type":"string","format":"date-time"},"evaluated_before":{"type":"string","format":"date-time"},"condition_type":{"type":"string","enum":["auto_failed_criteria","failed_criteria","partial_criteria"],"default":"auto_failed_criteria"},"condition_criterion_ids":{"type":"array","items":{"type":"string"},"maxItems":100,"default":[]},"conversation_ids":{"type":"array","items":{"type":"string"},"maxItems":500,"default":[]},"target_criterion_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100},"confirm":{"type":"boolean"}},"required":["target_criterion_ids"]}}}},"responses":{"201":{"description":"Run created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"total_items":{"type":"integer"}},"required":["id","total_items"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Confirmation required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"re_evaluable_evaluations":{"type":"integer"}},"required":["error","re_evaluable_evaluations"]}}}},"422":{"description":"Invalid selection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"selection_mode":{"type":"string"},"condition_type":{"type":"string"},"condition_criterion_ids":{"type":"array","items":{"type":"string"}},"target_criterion_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"evaluated_after":{"type":"string","nullable":true},"evaluated_before":{"type":"string","nullable":true},"total_items":{"type":"integer"},"completed_items":{"type":"integer"},"failed_items":{"type":"integer"},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true}},"required":["id","status","selection_mode","condition_type","condition_criterion_ids","target_criterion_ids","conversation_ids","evaluated_after","evaluated_before","total_items","completed_items","failed_items","error_message","created_at","updated_at","completed_at"]}}},"required":["runs"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_re_evaluation_runs/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Run detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"selection_mode":{"type":"string"},"condition_type":{"type":"string"},"condition_criterion_ids":{"type":"array","items":{"type":"string"}},"target_criterion_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"evaluated_after":{"type":"string","nullable":true},"evaluated_before":{"type":"string","nullable":true},"total_items":{"type":"integer"},"completed_items":{"type":"integer"},"failed_items":{"type":"integer"},"error_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"completed_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"conversation_prefix_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"qa_agent_evaluation_prefix_id":{"type":"string","nullable":true},"subject_employee_name":{"type":"string","nullable":true},"previous_overall_score":{"type":"number","nullable":true},"new_overall_score":{"type":"number","nullable":true},"error_message":{"type":"string","nullable":true},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source_scorecard_criterion_id":{"type":"string"},"criterion_name":{"type":"string","nullable":true},"previous_score_option_label":{"type":"string","nullable":true},"new_score_option_label":{"type":"string","nullable":true},"previous_criterion_score":{"type":"number","nullable":true},"new_criterion_score":{"type":"number","nullable":true}},"required":["id","source_scorecard_criterion_id","criterion_name","previous_score_option_label","new_score_option_label","previous_criterion_score","new_criterion_score"]}}},"required":["id","status","conversation_prefix_id","conversation_external_id","qa_agent_evaluation_prefix_id","subject_employee_name","previous_overall_score","new_overall_score","error_message","criteria"]}}},"required":["id","status","selection_mode","condition_type","condition_criterion_ids","target_criterion_ids","conversation_ids","evaluated_after","evaluated_before","total_items","completed_items","failed_items","error_message","created_at","updated_at","completed_at","items"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/qa_re_evaluation_runs/{id}/retry":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Retried","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"retried":{"type":"integer"}},"required":["retried"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/manual_qa_evaluation_submissions":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"conversation_id","in":"query"},{"schema":{"type":"string","enum":["pending","approved","rejected"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","enum":["true"]},"required":false,"name":"feedback_for_current_user","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Manual QA evaluation submissions visible to the member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"conversation_id":{"type":"string"},"conversation_display_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"source_qa_evaluation_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"overall_score":{"type":"number","nullable":true},"reviewer_feedback":{"type":"string","nullable":true},"check_reviewer_feedback":{"type":"array","nullable":true,"items":{"type":"object","properties":{"subject_employee_id":{"type":"string","nullable":true,"minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000},"was_corrected":{"type":"boolean"}},"required":["scorecard_criterion_check_id","feedback","was_corrected"]}},"published_qa_evaluation":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"reviewed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"submitted_at":{"type":"string"},"reviewed_at":{"type":"string","nullable":true},"qa_evaluation":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","status","conversation_id","conversation_display_id","conversation_subject","evaluation_assignment_id","source_qa_evaluation_id","qa_evaluation_id","overall_score","reviewer_feedback","check_reviewer_feedback","published_qa_evaluation","submitted_by","reviewed_by","submitted_at","reviewed_at","qa_evaluation"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/manual_qa_evaluation_submissions":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string"},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1}},"required":["agent_evaluations"]}},"required":["qa_evaluation"]}}}},"responses":{"201":{"description":"Manual QA evaluation submitted for approval","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"conversation_id":{"type":"string"},"conversation_display_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"source_qa_evaluation_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"overall_score":{"type":"number","nullable":true},"reviewer_feedback":{"type":"string","nullable":true},"check_reviewer_feedback":{"type":"array","nullable":true,"items":{"type":"object","properties":{"subject_employee_id":{"type":"string","nullable":true,"minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000},"was_corrected":{"type":"boolean"}},"required":["scorecard_criterion_check_id","feedback","was_corrected"]}},"published_qa_evaluation":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"reviewed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"submitted_at":{"type":"string"},"reviewed_at":{"type":"string","nullable":true},"qa_evaluation":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","status","conversation_id","conversation_display_id","conversation_subject","evaluation_assignment_id","source_qa_evaluation_id","qa_evaluation_id","overall_score","reviewer_feedback","check_reviewer_feedback","published_qa_evaluation","submitted_by","reviewed_by","submitted_at","reviewed_at","qa_evaluation"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation or organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Submission could not be created","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/manual_qa_evaluation_submissions/{id}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string"},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1}},"required":["agent_evaluations"]}},"required":["qa_evaluation"]}}}},"responses":{"200":{"description":"Manual QA evaluation submission updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"conversation_id":{"type":"string"},"conversation_display_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"source_qa_evaluation_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"overall_score":{"type":"number","nullable":true},"reviewer_feedback":{"type":"string","nullable":true},"check_reviewer_feedback":{"type":"array","nullable":true,"items":{"type":"object","properties":{"subject_employee_id":{"type":"string","nullable":true,"minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000},"was_corrected":{"type":"boolean"}},"required":["scorecard_criterion_check_id","feedback","was_corrected"]}},"published_qa_evaluation":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"reviewed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"submitted_at":{"type":"string"},"reviewed_at":{"type":"string","nullable":true},"qa_evaluation":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","status","conversation_id","conversation_display_id","conversation_subject","evaluation_assignment_id","source_qa_evaluation_id","qa_evaluation_id","overall_score","reviewer_feedback","check_reviewer_feedback","published_qa_evaluation","submitted_by","reviewed_by","submitted_at","reviewed_at","qa_evaluation"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Submission not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Submission could not be updated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/manual_qa_evaluation_submissions/{id}/approve":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewer_feedback":{"type":"string","nullable":true,"maxLength":4000},"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string"},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1}},"required":["agent_evaluations"]},"check_reviewer_feedback":{"type":"array","items":{"type":"object","properties":{"subject_employee_id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000}},"required":["subject_employee_id","scorecard_criterion_check_id"]}}}}}}},"responses":{"200":{"description":"Manual QA evaluation submission approved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"conversation_id":{"type":"string"},"conversation_display_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"source_qa_evaluation_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"overall_score":{"type":"number","nullable":true},"reviewer_feedback":{"type":"string","nullable":true},"check_reviewer_feedback":{"type":"array","nullable":true,"items":{"type":"object","properties":{"subject_employee_id":{"type":"string","nullable":true,"minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000},"was_corrected":{"type":"boolean"}},"required":["scorecard_criterion_check_id","feedback","was_corrected"]}},"published_qa_evaluation":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"reviewed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"submitted_at":{"type":"string"},"reviewed_at":{"type":"string","nullable":true},"qa_evaluation":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","status","conversation_id","conversation_display_id","conversation_subject","evaluation_assignment_id","source_qa_evaluation_id","qa_evaluation_id","overall_score","reviewer_feedback","check_reviewer_feedback","published_qa_evaluation","submitted_by","reviewed_by","submitted_at","reviewed_at","qa_evaluation"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Submission not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Submission could not be approved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/manual_qa_evaluation_submissions/{id}/reject":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"reviewer_feedback":{"type":"string","nullable":true,"maxLength":4000},"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string"},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1}},"required":["agent_evaluations"]},"check_reviewer_feedback":{"type":"array","items":{"type":"object","properties":{"subject_employee_id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000}},"required":["subject_employee_id","scorecard_criterion_check_id"]}}}}}}},"responses":{"200":{"description":"Manual QA evaluation submission rejected","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","approved","rejected"]},"conversation_id":{"type":"string"},"conversation_display_id":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"source_qa_evaluation_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"overall_score":{"type":"number","nullable":true},"reviewer_feedback":{"type":"string","nullable":true},"check_reviewer_feedback":{"type":"array","nullable":true,"items":{"type":"object","properties":{"subject_employee_id":{"type":"string","nullable":true,"minLength":1},"scorecard_criterion_check_id":{"type":"string","minLength":1},"feedback":{"type":"string","nullable":true,"maxLength":4000},"was_corrected":{"type":"boolean"}},"required":["scorecard_criterion_check_id","feedback","was_corrected"]}},"published_qa_evaluation":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"reviewed_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]},"submitted_at":{"type":"string"},"reviewed_at":{"type":"string","nullable":true},"qa_evaluation":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","status","conversation_id","conversation_display_id","conversation_subject","evaluation_assignment_id","source_qa_evaluation_id","qa_evaluation_id","overall_score","reviewer_feedback","check_reviewer_feedback","published_qa_evaluation","submitted_by","reviewed_by","submitted_at","reviewed_at","qa_evaluation"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Submission not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Submission could not be rejected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/manual_qa_evaluations":{"post":{"summary":"Create a manual QA evaluation for a conversation","tags":["Manual QA evaluations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string","nullable":true},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1},"file_signed_ids":{"type":"array","items":{"type":"string"}}},"required":["agent_evaluations"]}},"required":["qa_evaluation"]}}}},"responses":{"201":{"description":"Manual QA evaluation created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string","nullable":true},"evaluation_assignment_status":{"type":"string","nullable":true,"enum":["pending","in_progress","completed"]},"overall_score":{"type":"number","nullable":true},"qa_agent_evaluation_ids":{"type":"array","items":{"type":"string"}}},"required":["id","conversation_id","evaluation_assignment_id","evaluation_assignment_status","overall_score","qa_agent_evaluation_ids"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Evaluation could not be saved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/manual_qa_evaluations/{id}":{"patch":{"summary":"Update a manual QA evaluation","tags":["Manual QA evaluations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"qa_evaluation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string","nullable":true},"agent_evaluations":{"type":"array","items":{"nullable":true},"minItems":1},"file_signed_ids":{"type":"array","items":{"type":"string"}}},"required":["agent_evaluations"]}},"required":["qa_evaluation"]}}}},"responses":{"200":{"description":"Manual QA evaluation updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"evaluation_assignment_id":{"type":"string","nullable":true},"evaluation_assignment_status":{"type":"string","nullable":true,"enum":["pending","in_progress","completed"]},"overall_score":{"type":"number","nullable":true},"qa_agent_evaluation_ids":{"type":"array","items":{"type":"string"}}},"required":["id","conversation_id","evaluation_assignment_id","evaluation_assignment_status","overall_score","qa_agent_evaluation_ids"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Evaluation could not be saved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_contest_feedback_attachments":{"post":{"operationId":"createEvaluationContestFeedbackAttachment","summary":"Upload an image for contest feedback","tags":["Attachments"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"200":{"description":"Blob created; attach it with the returned signed id","content":{"application/json":{"schema":{"type":"object","properties":{"signed_id":{"type":"string"}},"required":["signed_id"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Missing or non-image file","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}}}}},"/qa_evaluation_attachments":{"post":{"operationId":"createQaEvaluationAttachment","summary":"Upload an image for a manual QA evaluation","tags":["Attachments"],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"200":{"description":"Blob created; attach it with the returned signed id","content":{"application/json":{"schema":{"type":"object","properties":{"signed_id":{"type":"string"}},"required":["signed_id"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Missing or non-image file","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}}}}},"/rails/active_storage/direct_uploads":{"post":{"operationId":"createActiveStorageDirectUpload","summary":"Create an Active Storage blob for a browser direct upload","tags":["Attachments"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blob":{"type":"object","properties":{"filename":{"type":"string"},"content_type":{"type":"string","nullable":true},"byte_size":{"type":"integer"},"checksum":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["filename","byte_size","checksum"]}},"required":["blob"]}}}},"responses":{"200":{"description":"Blob created; PUT the file to `direct_upload.url`","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"number"},"key":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"byte_size":{"type":"number"},"checksum":{"type":"string"},"created_at":{"type":"string"},"signed_id":{"type":"string"},"direct_upload":{"type":"object","properties":{"url":{"type":"string"},"headers":{"type":"object","additionalProperties":{"type":"string"}}},"required":["url","headers"]}},"required":["id","key","filename","content_type","metadata","byte_size","checksum","created_at","signed_id","direct_upload"]}}}},"422":{"description":"Invalid blob params","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["errors"]}}}}}}},"/conversations/{conversation_id}/conversation_assignments":{"post":{"summary":"Assign or unassign a conversation","tags":["Conversations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"assignee_id":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Conversation unassigned","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"resolution_comment":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"created_by_type":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"assignee_id":{"type":"string"},"assignee_membership_id":{"type":"string","nullable":true},"resolver_id":{"type":"string","nullable":true},"assignment_queue_id":{"type":"string","nullable":true},"created_by_membership_id":{"type":"string","nullable":true},"transferred_by_membership_id":{"type":"string","nullable":true}},"required":["id","status","created_at","resolved_at","resolution_comment","ended_at","created_by_type","conversation_id","assignee_id","assignee_membership_id","resolver_id","assignment_queue_id","created_by_membership_id","transferred_by_membership_id"]}},"required":["data"]}}}},"201":{"description":"Conversation assigned","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"resolution_comment":{"type":"string","nullable":true},"ended_at":{"type":"string","nullable":true},"created_by_type":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"assignee_id":{"type":"string"},"assignee_membership_id":{"type":"string","nullable":true},"resolver_id":{"type":"string","nullable":true},"assignment_queue_id":{"type":"string","nullable":true},"created_by_membership_id":{"type":"string","nullable":true},"transferred_by_membership_id":{"type":"string","nullable":true}},"required":["id","status","created_at","resolved_at","resolution_comment","ended_at","created_by_type","conversation_id","assignee_id","assignee_membership_id","resolver_id","assignment_queue_id","created_by_membership_id","transferred_by_membership_id"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not be saved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{id}/resolve":{"post":{"summary":"Resolve a conversation's review","tags":["Conversations"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"review_comment":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Conversation resolved","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"started_at":{"type":"string","nullable":true,"format":"date-time"},"ended_at":{"type":"string","nullable":true,"format":"date-time"},"summary":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"reference_id":{"type":"string","nullable":true},"previous_context":{"type":"string","nullable":true},"external_created_at":{"type":"string","nullable":true,"format":"date-time"},"subject":{"type":"string"},"external_url":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"source_channel":{"type":"string","nullable":true},"source_deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"agent_summary":{"type":"string","nullable":true},"closed_at":{"type":"string","nullable":true,"format":"date-time"},"resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"review_comment":{"type":"string","nullable":true},"last_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"first_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"last_synced_at":{"type":"string","nullable":true,"format":"date-time"},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"handling_time":{"type":"string","nullable":true},"time_to_first_response_seconds":{"type":"integer","nullable":true},"channel_types":{"type":"array","items":{"type":"string"}},"initial_contact_at":{"type":"string","nullable":true,"format":"date-time"},"last_contact_at":{"type":"string","nullable":true,"format":"date-time"},"contacts_count":{"type":"integer","nullable":true},"conversation_customer_sentiment_summary":{"type":"object","nullable":true,"properties":{"score":{"type":"number"},"level":{"nullable":true}},"required":["score","level"]},"interaction_type":{"type":"string"},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"review_status":{"type":"string","enum":["unresolved","resolved","compliance_review","none"]},"ticket_status":{"type":"string","enum":["open","resolved"]},"qa_score_ai":{"type":"number","nullable":true},"qa_score_human":{"type":"number","nullable":true},"qa_score_effective":{"type":"number","nullable":true},"qa_score_updated_at":{"type":"string","nullable":true,"format":"date-time"},"qa_auto_fail":{"type":"boolean"},"previous_sentiment_score":{"type":"string","nullable":true},"custom_attributes":{"nullable":true},"translated_at":{"type":"string","nullable":true,"format":"date-time"},"language":{"type":"string","nullable":true},"live_summary":{"type":"string","nullable":true},"evaluation_state":{"type":"string"},"transcription_state":{"type":"string"},"translation_state":{"type":"string"},"risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"qa_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"complaint_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"dispute_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"compliance_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"product_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"service_issue_risk_level":{"type":"string","enum":["unknown","none","low","medium","high"]},"churn_risk_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"requester":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"nullable":true},"type":{"type":"string","nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"customer_interaction_type":{"type":"string","nullable":true}},"required":["id","name","type","customer_interaction_type"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","full_name","email","created_at","updated_at"]},"resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"assignment_queue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"integer"},"created_at":{"type":"string","nullable":true,"format":"date-time"},"updated_at":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","members_count","created_at","updated_at"]},"customer_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true}},"required":["id","name","description"]},"conversation_agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"eligible_for_qa_evaluation":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"employee":{"type":"object","properties":{"employment_started_on":{"type":"string","nullable":true},"tenure_status":{"type":"string","nullable":true,"enum":["new_joiner","tenured"]},"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","enum":["human","bot"]},"phone":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"employee_id":{"type":"string","nullable":true},"job_title":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true},"agent_role":{"type":"string","nullable":true,"enum":["sales","customer_service"]},"rulebase_invitation_status":{"type":"string","enum":["not_invited","invite_pending","invited"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"group_memberships_count":{"type":"integer"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"connection_name":{"type":"string","nullable":true}},"required":["id","name","full_name","created_at","updated_at","group_memberships_count","employees_count","parent_group_id","parent_group_name","connection_name"]},"team_id":{"type":"string","nullable":true},"team_name":{"type":"string","nullable":true},"bot_provider_id":{"type":"string","nullable":true},"manager_name":{"type":"string","nullable":true},"manager_id":{"type":"string","nullable":true},"evaluable":{"type":"boolean"},"direct_reports_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"qa_summary":{"type":"string","nullable":true},"qa_score":{"type":"number","nullable":true},"average_handling_time":{"type":"number","nullable":true},"average_qa_score_delta":{"type":"number","nullable":true},"latest_agent_performance_report_end_date":{"type":"string","nullable":true},"latest_agent_performance_report_id":{"type":"string","nullable":true}},"required":["employment_started_on","tenure_status","id","name","type","phone","email","employee_id","job_title","avatar_url","agent_role","rulebase_invitation_status","group","team_id","team_name","bot_provider_id","manager_name","manager_id","evaluable","direct_reports_count","created_at","updated_at","qa_summary","qa_score","average_handling_time","average_qa_score_delta","latest_agent_performance_report_end_date","latest_agent_performance_report_id"]}},"required":["id","eligible_for_qa_evaluation","created_at","updated_at","employee"]}},"applied_tags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"normalized_name":{"type":"string"},"summary":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","normalized_name","summary","created_at","updated_at"]}},"tags":{"type":"array","items":{"type":"string","enum":["complaint","dispute","product_issue","service_issue","compliance_risk","qa"]}},"customer_complaints":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["id","title","summary","categories"]}},"clients":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]}},"field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"conversation_field":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"required":["id","created_at","updated_at","conversation_field"]}},"url":{"type":"string","format":"uri"},"description":{"type":"string","nullable":true},"qa_risk_summary":{"type":"string","nullable":true},"individual_agents_evaluated":{"type":"boolean"},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","created_at","updated_at"]},"zendesk_brand":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"tracking_status":{"type":"string","nullable":true},"help_center_locales":{"type":"array","items":{"type":"string"}},"avatar_url":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","subdomain","external_id","tracking_status","help_center_locales","avatar_url","created_at","updated_at"]},"group":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"full_name":{"type":"string"},"employees_count":{"type":"integer"},"parent_group_id":{"type":"string","nullable":true},"parent_group_name":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","name","full_name","employees_count","parent_group_id","parent_group_name","created_at","updated_at"]},"partners":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"dispute":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"summary":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"amount":{"type":"number","nullable":true},"currency_code":{"type":"string","nullable":true},"filed_at":{"type":"string","nullable":true},"resolution_due_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"resolution_summary":{"type":"string","nullable":true},"acknowledged_at":{"type":"string","nullable":true},"acknowledgement_due_at":{"type":"string","nullable":true},"jira_issue_key":{"type":"string","nullable":true},"conversation_id":{"type":"string"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","summary","status","amount","currency_code","filed_at","resolution_due_at","resolved_at","resolution_summary","acknowledged_at","acknowledgement_due_at","jira_issue_key","conversation_id","created_at","updated_at"]},"manual_evaluation":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"overall_score":{"type":"number"},"max_score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","full_name","email","created_at","updated_at"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"scorecard":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"}},"required":["id","name","description","nested_criteria","two_level"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"weight":{"type":"number"},"comment":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"scoring_type":{"type":"string","nullable":true},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"}},"required":["id","description","position","scoring_type","max_score","weight"]},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"value":{"type":"number"}},"required":["id","label","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","content"]}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","weight","comment","created_at","updated_at","scorecard_criterion","selected_score_option","selected_justification_option","children"]}}},"required":["id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","scorecard","criterion_results"]}}},"required":["id","overall_score","max_score","created_at","updated_at","evaluator","scorecard_results"]},"sla_breaches":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}},"conversation_part_sla_breaches":{"type":"object","additionalProperties":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["email_response_time","chat_response_time","resolution_time"]},"threshold":{"type":"integer"},"conversation_id":{"type":"string"},"conversation_part_id":{"type":"string","nullable":true},"conversation_date":{"type":"string","nullable":true},"expected_at":{"type":"string","nullable":true},"conversation_priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string","enum":["all","any"]},"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","value","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"integer"},"metric":{"type":"string","enum":["first_response_time","next_response_time","resolution_time"]},"priority":{"type":"string","enum":["none","low","normal","high","urgent"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","type","threshold","conversation_id","conversation_part_id","conversation_date","expected_at","conversation_priority","created_at","updated_at","policy","workload_context"]}}}},"required":["id","started_at","ended_at","summary","external_id","reference_id","previous_context","external_created_at","subject","external_url","jira_issue_key","source_channel","source_deleted_at","created_at","updated_at","agent_summary","closed_at","resolved_at","review_resolved_at","review_comment","last_evaluated_at","first_evaluated_at","qa_evaluated_at","last_synced_at","last_assigned_at","handling_time","time_to_first_response_seconds","channel_types","initial_contact_at","last_contact_at","contacts_count","conversation_customer_sentiment_summary","interaction_type","priority","review_status","ticket_status","qa_score_ai","qa_score_human","qa_score_effective","qa_score_updated_at","qa_auto_fail","previous_sentiment_score","translated_at","language","live_summary","evaluation_state","transcription_state","translation_state","risk_level","qa_risk_level","complaint_risk_level","dispute_risk_level","compliance_risk_level","product_issue_risk_level","service_issue_risk_level","churn_risk_level","requester","data_source","assignee","resolver","assignment_queue","customer_issue","conversation_agents","applied_tags","tags","customer_complaints","clients","field_values","url","description","qa_risk_summary","individual_agents_evaluated","company","zendesk_brand","group","partners","dispute","manual_evaluation","sla_breaches","conversation_part_sla_breaches"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Could not be saved","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/jira_request_types":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"sync","in":"query"}],"responses":{"200":{"description":"Jira request types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]}}},"required":["data"]}}}}}}},"/jira_request_types/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Jira request type found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/{conversation_id}/jira_issue_drafts":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"conversation_id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Jira issue drafts found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/jira_issue_drafts/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Jira issue draft found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jira_issue_draft":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"nullable":true}},"jira_request_type_id":{"type":"string"},"conversation_id":{"type":"string","nullable":true}}}},"required":["jira_issue_draft"]}}}},"responses":{"200":{"description":"Jira issue draft updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}}}}},"/jira_issue_drafts":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jira_issue_draft":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"jira_request_type_id":{"type":"string"},"conversation_id":{"type":"string","nullable":true}},"required":["jira_request_type_id"]}},"required":["jira_issue_draft"]}}}},"responses":{"201":{"description":"Jira issue draft created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}}}}},"/jira_issue_drafts/{id}/migrate":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jira_issue_draft":{"type":"object","properties":{"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["data"]}},"required":["jira_issue_draft"]}}}},"responses":{"200":{"description":"Rails Jira issue draft migrated to API2","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}}}}},"/jira_issue_drafts/{id}/submit":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Jira issue draft submitted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}}}}},"/jira_issue_drafts/{id}/cancel":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Jira issue draft canceled","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pending","submitted","canceled"]},"data":{"type":"object","additionalProperties":{"nullable":true}},"submitted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"issue_type_id":{"type":"string"},"service_desk_id":{"type":"string"},"suggestion_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"type":"array","items":{"nullable":true}},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","valid_values","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","name","external_id","issue_type_id","service_desk_id","suggestion_instructions","created_at","updated_at","fields","source"]},"submitted_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"created_by":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"url":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","issue_key","summary","status_category","url","service_desk_url","created_at","updated_at","source"]},"source":{"type":"string","enum":["api2","rails"]}},"required":["id","status","data","submitted_at","created_at","updated_at","jira_request_type","submitted_by","created_by","jira_issue","source"]}},"required":["data"]}}}}}}},"/conversations/import":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_import":{"type":"object","properties":{"external_id":{"type":"string","minLength":1}},"required":["external_id"]}},"required":["conversation_import"]}}}},"responses":{"201":{"description":"Zendesk conversation imported","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Zendesk ticket not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Conversation already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/suggested-tasks":{"get":{"responses":{"200":{"description":"Live workbench task suggestions for the current member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"reason":{"type":"string"},"prompt":{"type":"string"},"position":{"type":"number"}},"required":["id","title","reason","prompt","position"]}}},"required":["data"]}}}}}}},"/internal/tasks":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"campaignId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"chatId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"companyId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"owner","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List tasks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"instructions":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"companyId":{"type":"string","nullable":true},"campaignId":{"type":"string","nullable":true,"format":"uuid"},"ownerMembershipId":{"type":"string","nullable":true},"ownerAgentId":{"type":"string","nullable":true},"owner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["membership","agent"]},"name":{"type":"string"}},"required":["id","type","name"]},"scheduledFor":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"currentTaskRunId":{"type":"string","nullable":true},"claimedAt":{"type":"string","nullable":true},"claimExpiresAt":{"type":"string","nullable":true},"createdByType":{"type":"string","enum":["user","agent","system"]},"createdByMembershipId":{"type":"string","nullable":true},"createdByAgentId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"primaryReference":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]}},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name","logoUrl"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","title","instructions","description","status","companyId","campaignId","ownerMembershipId","ownerAgentId","owner","scheduledFor","dueAt","completedAt","currentTaskRunId","claimedAt","claimExpiresAt","createdByType","createdByMembershipId","createdByAgentId","metadata","primaryReference","references","company","createdAt","updatedAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"instructions":{"type":"string","nullable":true,"minLength":1,"maxLength":4000},"description":{"type":"string","nullable":true,"maxLength":4000},"companyId":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"ownerMembershipId":{"type":"string","nullable":true,"minLength":1},"ownerAgentId":{"type":"string","nullable":true,"minLength":1},"scheduledFor":{"type":"string","nullable":true,"format":"date-time"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"references":{"type":"array","items":{"type":"object","properties":{"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string","minLength":1},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true,"minLength":1},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["objectType","objectId","role"]}}}}}}},"responses":{"201":{"description":"Task created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"instructions":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"companyId":{"type":"string","nullable":true},"campaignId":{"type":"string","nullable":true,"format":"uuid"},"ownerMembershipId":{"type":"string","nullable":true},"ownerAgentId":{"type":"string","nullable":true},"owner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["membership","agent"]},"name":{"type":"string"}},"required":["id","type","name"]},"scheduledFor":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"currentTaskRunId":{"type":"string","nullable":true},"claimedAt":{"type":"string","nullable":true},"claimExpiresAt":{"type":"string","nullable":true},"createdByType":{"type":"string","enum":["user","agent","system"]},"createdByMembershipId":{"type":"string","nullable":true},"createdByAgentId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"primaryReference":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]}},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name","logoUrl"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"currentRun":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"triggerType":{"type":"string","enum":["manual","signal","scheduled","webhook"]},"instruction":{"type":"string","nullable":true},"resultSummary":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"finishedAt":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","taskId","status","triggerType","instruction","resultSummary","errorMessage","startedAt","finishedAt","metadata","createdAt","updatedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"taskRunId":{"type":"string","nullable":true},"sequence":{"type":"integer"},"eventType":{"type":"string"},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"toolInput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"toolOutput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"errorMessage":{"type":"string","nullable":true},"externalObjectType":{"type":"string","nullable":true},"externalObjectId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","taskRunId","sequence","eventType","actorType","actorMembershipId","actorAgentId","actorName","status","title","summary","toolName","toolInput","toolOutput","errorMessage","externalObjectType","externalObjectId","metadata","createdAt"]}}},"required":["id","organizationId","title","instructions","description","status","companyId","campaignId","ownerMembershipId","ownerAgentId","owner","scheduledFor","dueAt","completedAt","currentTaskRunId","claimedAt","claimExpiresAt","createdByType","createdByMembershipId","createdByAgentId","metadata","primaryReference","references","company","createdAt","updatedAt","currentRun","events"]}},"required":["data"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid task","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/tasks/{taskId}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"responses":{"200":{"description":"Task detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"instructions":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"companyId":{"type":"string","nullable":true},"campaignId":{"type":"string","nullable":true,"format":"uuid"},"ownerMembershipId":{"type":"string","nullable":true},"ownerAgentId":{"type":"string","nullable":true},"owner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["membership","agent"]},"name":{"type":"string"}},"required":["id","type","name"]},"scheduledFor":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"currentTaskRunId":{"type":"string","nullable":true},"claimedAt":{"type":"string","nullable":true},"claimExpiresAt":{"type":"string","nullable":true},"createdByType":{"type":"string","enum":["user","agent","system"]},"createdByMembershipId":{"type":"string","nullable":true},"createdByAgentId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"primaryReference":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]}},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name","logoUrl"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"currentRun":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"triggerType":{"type":"string","enum":["manual","signal","scheduled","webhook"]},"instruction":{"type":"string","nullable":true},"resultSummary":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"finishedAt":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","taskId","status","triggerType","instruction","resultSummary","errorMessage","startedAt","finishedAt","metadata","createdAt","updatedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"taskRunId":{"type":"string","nullable":true},"sequence":{"type":"integer"},"eventType":{"type":"string"},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"toolInput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"toolOutput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"errorMessage":{"type":"string","nullable":true},"externalObjectType":{"type":"string","nullable":true},"externalObjectId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","taskRunId","sequence","eventType","actorType","actorMembershipId","actorAgentId","actorName","status","title","summary","toolName","toolInput","toolOutput","errorMessage","externalObjectType","externalObjectId","metadata","createdAt"]}}},"required":["id","organizationId","title","instructions","description","status","companyId","campaignId","ownerMembershipId","ownerAgentId","owner","scheduledFor","dueAt","completedAt","currentTaskRunId","claimedAt","claimExpiresAt","createdByType","createdByMembershipId","createdByAgentId","metadata","primaryReference","references","company","createdAt","updatedAt","currentRun","events"]}},"required":["data"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","nullable":true,"maxLength":4000},"companyId":{"type":"string","nullable":true,"minLength":1},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"ownerMembershipId":{"type":"string","nullable":true,"minLength":1},"ownerAgentId":{"type":"string","nullable":true,"minLength":1},"scheduledFor":{"type":"string","nullable":true,"format":"date-time"},"dueAt":{"type":"string","nullable":true,"format":"date-time"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"responses":{"200":{"description":"Task updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"instructions":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"companyId":{"type":"string","nullable":true},"campaignId":{"type":"string","nullable":true,"format":"uuid"},"ownerMembershipId":{"type":"string","nullable":true},"ownerAgentId":{"type":"string","nullable":true},"owner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["membership","agent"]},"name":{"type":"string"}},"required":["id","type","name"]},"scheduledFor":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"currentTaskRunId":{"type":"string","nullable":true},"claimedAt":{"type":"string","nullable":true},"claimExpiresAt":{"type":"string","nullable":true},"createdByType":{"type":"string","enum":["user","agent","system"]},"createdByMembershipId":{"type":"string","nullable":true},"createdByAgentId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"primaryReference":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]}},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name","logoUrl"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"currentRun":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"triggerType":{"type":"string","enum":["manual","signal","scheduled","webhook"]},"instruction":{"type":"string","nullable":true},"resultSummary":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"finishedAt":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","taskId","status","triggerType","instruction","resultSummary","errorMessage","startedAt","finishedAt","metadata","createdAt","updatedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"taskRunId":{"type":"string","nullable":true},"sequence":{"type":"integer"},"eventType":{"type":"string"},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"toolInput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"toolOutput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"errorMessage":{"type":"string","nullable":true},"externalObjectType":{"type":"string","nullable":true},"externalObjectId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","taskRunId","sequence","eventType","actorType","actorMembershipId","actorAgentId","actorName","status","title","summary","toolName","toolInput","toolOutput","errorMessage","externalObjectType","externalObjectId","metadata","createdAt"]}}},"required":["id","organizationId","title","instructions","description","status","companyId","campaignId","ownerMembershipId","ownerAgentId","owner","scheduledFor","dueAt","completedAt","currentTaskRunId","claimedAt","claimExpiresAt","createdByType","createdByMembershipId","createdByAgentId","metadata","primaryReference","references","company","createdAt","updatedAt","currentRun","events"]}},"required":["data"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid task","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"responses":{"204":{"description":"Task deleted"},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/tasks/bulk_destroy":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":100}},"required":["ids"]}}}},"responses":{"200":{"description":"Tasks deleted","content":{"application/json":{"schema":{"type":"object","properties":{"deleted_count":{"type":"integer"},"skipped_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["deleted_count","skipped_ids"]}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/tasks/{taskId}/responses":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"taskId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":4000},"title":{"type":"string","nullable":true,"minLength":1,"maxLength":200},"scheduledFor":{"type":"string","nullable":true,"format":"date-time"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["summary"]}}}},"responses":{"200":{"description":"Task response created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"title":{"type":"string"},"instructions":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","in_progress","waiting","failed","completed","canceled"]},"companyId":{"type":"string","nullable":true},"campaignId":{"type":"string","nullable":true,"format":"uuid"},"ownerMembershipId":{"type":"string","nullable":true},"ownerAgentId":{"type":"string","nullable":true},"owner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string","enum":["membership","agent"]},"name":{"type":"string"}},"required":["id","type","name"]},"scheduledFor":{"type":"string","nullable":true},"dueAt":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true},"currentTaskRunId":{"type":"string","nullable":true},"claimedAt":{"type":"string","nullable":true},"claimExpiresAt":{"type":"string","nullable":true},"createdByType":{"type":"string","enum":["user","agent","system"]},"createdByMembershipId":{"type":"string","nullable":true},"createdByAgentId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"primaryReference":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]},"references":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"objectType":{"type":"string","enum":["company","onboarding_case","onboarding_requirement","onboarding_submission","conversation","ticket","external"]},"objectId":{"type":"string"},"role":{"type":"string","enum":["primary","related","source","target","result"]},"label":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","objectType","objectId","role","label","metadata","createdAt"]}},"company":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"logoUrl":{"type":"string","nullable":true,"format":"uri"}},"required":["id","name","logoUrl"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"currentRun":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"status":{"type":"string","enum":["running","succeeded","failed","canceled"]},"triggerType":{"type":"string","enum":["manual","signal","scheduled","webhook"]},"instruction":{"type":"string","nullable":true},"resultSummary":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"startedAt":{"type":"string"},"finishedAt":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","taskId","status","triggerType","instruction","resultSummary","errorMessage","startedAt","finishedAt","metadata","createdAt","updatedAt"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"taskId":{"type":"string"},"taskRunId":{"type":"string","nullable":true},"sequence":{"type":"integer"},"eventType":{"type":"string"},"actorType":{"type":"string","enum":["user","agent","system"]},"actorMembershipId":{"type":"string","nullable":true},"actorAgentId":{"type":"string","nullable":true},"actorName":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"toolInput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"toolOutput":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"errorMessage":{"type":"string","nullable":true},"externalObjectType":{"type":"string","nullable":true},"externalObjectId":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","organizationId","taskId","taskRunId","sequence","eventType","actorType","actorMembershipId","actorAgentId","actorName","status","title","summary","toolName","toolInput","toolOutput","errorMessage","externalObjectType","externalObjectId","metadata","createdAt"]}}},"required":["id","organizationId","title","instructions","description","status","companyId","campaignId","ownerMembershipId","ownerAgentId","owner","scheduledFor","dueAt","completedAt","currentTaskRunId","claimedAt","claimExpiresAt","createdByType","createdByMembershipId","createdByAgentId","metadata","primaryReference","references","company","createdAt","updatedAt","currentRun","events"]}},"required":["data"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid response","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_imports/preview":{"post":{"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files":{"type":"array","items":{"type":"string","format":"binary"}},"target_work_item_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"Agent-generated work item import preview stream","content":{"text/event-stream":{"schema":{"type":"string"}}}}}}},"/work_item_imports/confirm":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"preview":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1},"role":{"type":"string","enum":["work_items","events","mixed","ignored"]},"notes":{"type":"string","minLength":1}},"required":["name","role","notes"]}},"mappings":{"type":"array","items":{"type":"object","properties":{"source_file":{"type":"string","minLength":1},"source_field":{"type":"string","minLength":1},"target_field":{"type":"string","minLength":1},"notes":{"type":"string","minLength":1}},"required":["source_file","source_field","target_field"]}},"work_items":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"agent":{"type":"object","properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","minLength":1},"external_id":{"type":"string","minLength":1}},"default":{}},"type":{"type":"string","minLength":1},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"source":{"type":"object","properties":{"file":{"type":"string","minLength":1},"row":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["file"]}},"required":["external_id","source"]}},"events":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1},"work_item_external_id":{"type":"string","minLength":1},"actor":{"type":"object","nullable":true,"properties":{"email":{"type":"string","format":"email"},"name":{"type":"string","minLength":1},"external_id":{"type":"string","minLength":1}}},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"source":{"type":"object","properties":{"file":{"type":"string","minLength":1},"row":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["file"]}},"required":["external_id","work_item_external_id","actor","content","occurred_at","source"]}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","minLength":1},"message":{"type":"string","minLength":1},"source_file":{"type":"string","minLength":1},"source_row":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["code","message"]}}},"required":["version","files","mappings","work_items","events","warnings"]},"target_work_item_id":{"type":"string","format":"uuid"}},"required":["preview"]}}}},"responses":{"201":{"description":"Work items and events imported","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"work_items":{"type":"integer","minimum":0},"events":{"type":"integer","minimum":0},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["work_items","events","work_item_ids"]}},"required":["data"]}}}},"422":{"description":"Preview could not be imported","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations":{"get":{"responses":{"200":{"description":"Calibrations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"calibration":{"type":"object","properties":{"name":{"type":"string","minLength":1},"subject_type":{"type":"string","enum":["conversation","work_item"]},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"assigned_account_ids":{"type":"array","items":{"type":"string"},"minItems":1},"evaluations_per_item":{"type":"integer","minimum":0,"exclusiveMinimum":true},"rotate_evaluator_pairs":{"type":"boolean"},"items_per_reviewer":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"sampling_percentage":{"type":"integer","nullable":true,"minimum":1,"maximum":100},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true}},"required":["name","subject_type","assigned_account_ids"]}},"required":["calibration"]}}}},"responses":{"201":{"description":"Calibration created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"422":{"description":"Invalid calibration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/sample_preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"calibration":{"type":"object","properties":{"subject_type":{"type":"string","enum":["work_item","conversation"],"default":"work_item"},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"window_date_type":{"type":"string","nullable":true,"enum":["started","evaluated"]},"sampling_percentage":{"type":"integer","nullable":true,"minimum":1,"maximum":100},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}}}}},"required":["calibration"]}}}},"responses":{"200":{"description":"Work item calibration sample preview","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"eligible_count":{"type":"integer","minimum":0},"sample_size":{"type":"integer","minimum":0},"sampling_percentage":{"type":"integer","nullable":true}},"required":["eligible_count","sample_size","sampling_percentage"]}},"required":["data"]}}}},"422":{"description":"Invalid calibration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}/add_conversations":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_ids":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["conversation_ids"]}}}},"responses":{"200":{"description":"Calibration with the added conversations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"calibration":{"type":"object","properties":{"name":{"type":"string","minLength":1},"subject_type":{"type":"string","enum":["conversation","work_item"]},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"assigned_account_ids":{"type":"array","items":{"type":"string"},"minItems":1},"evaluations_per_item":{"type":"integer","minimum":0,"exclusiveMinimum":true},"rotate_evaluator_pairs":{"type":"boolean"},"items_per_reviewer":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"sampling_percentage":{"type":"integer","nullable":true,"minimum":1,"maximum":100},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true}}}},"required":["calibration"]}}}},"responses":{"200":{"description":"Calibration updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"422":{"description":"Invalid calibration","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Calibration deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}/items":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter[query]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter[evaluation_status]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"sort","in":"query"}],"responses":{"200":{"description":"Calibration items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_id":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"ai_qa_score":{"type":"number","nullable":true},"ai_qa_evaluation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overall_score":{"type":"number","nullable":true},"conversation_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}}},"required":["id","source","created_at","updated_at","overall_score","conversation_id","evaluator_membership_id","evaluation_assignment_id","conversation_cx_risk_snapshot_id","files","qa_agent_evaluations"]},{"type":"object","properties":{"id":{"type":"string"},"overall_score":{"type":"number","nullable":true}},"required":["id","overall_score"]},{"nullable":true}]},"human_qa_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overall_score":{"type":"number","nullable":true},"conversation_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}}},"required":["id","source","created_at","updated_at","overall_score","conversation_id","evaluator_membership_id","evaluation_assignment_id","conversation_cx_risk_snapshot_id","files","qa_agent_evaluations"]}},"evaluation_assignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]}},"ai_human_average_delta":{"type":"number","nullable":true},"human_human_average_delta":{"type":"number","nullable":true},"ai_human_alignment_score":{"type":"number","nullable":true},"human_human_alignment_score":{"type":"number","nullable":true},"evaluation_status":{"type":"string","enum":["none","pending","in_progress","completed"]},"evaluation_assignments_count":{"type":"number"},"completed_evaluation_assignments_count":{"type":"number"},"checks_count":{"type":"number"},"misaligned_checks_count":{"type":"number"},"ai_human_comparison_status":{"type":"string","enum":["not_ready","comparable","incompatible_scorecards","no_comparable_checks"]},"evaluation_batch_assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_id":{"type":"string"},"evaluator_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator_name":{"type":"string"},"evaluator_email":{"type":"string"},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"last_completed_index":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","evaluation_batch_id","evaluator_id","evaluator_membership_id","evaluator_name","evaluator_email","assignments_count","completed_count","last_completed_index","created_at","updated_at"]}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","evaluation_batch_id","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","ai_qa_score","ai_qa_evaluation","human_qa_evaluations","evaluation_assignments","ai_human_average_delta","human_human_average_delta","ai_human_alignment_score","human_human_alignment_score","evaluation_status","evaluation_assignments_count","completed_evaluation_assignments_count","checks_count","misaligned_checks_count","ai_human_comparison_status","evaluation_batch_assignees","agents","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/calibrations/{id}/assignments":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration assignments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/calibrations/{id}/assignees":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration assignees","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_id":{"type":"string"},"evaluator_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator_name":{"type":"string"},"evaluator_email":{"type":"string"},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"last_completed_index":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","evaluation_batch_id","evaluator_id","evaluator_membership_id","evaluator_name","evaluator_email","assignments_count","completed_count","last_completed_index","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/calibration_assignees":{"get":{"parameters":[{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluation_batch_status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluation_batch_started_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"evaluation_batch_started_before","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Assignees across calibrations with at least one assignment","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CalibrationGlobalAssignee"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"422":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}/export":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"select_all":{"type":"boolean","nullable":true},"conversation_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"filter":{"type":"object","nullable":true,"properties":{"query":{"type":"string","nullable":true},"evaluation_status":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"},{"nullable":true}]}}}}}}}},"responses":{"200":{"description":"Calibration ticket CSV export","content":{"text/csv":{"schema":{"type":"string"}}}},"404":{"description":"Calibration not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}/statistics":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accuracy":{"type":"number","nullable":true},"average_ai_qa_score":{"type":"number","nullable":true},"average_evaluator_qa_score":{"type":"number","nullable":true},"distinct_evaluators_count":{"type":"number"},"evaluation_assignment_count":{"type":"number"},"total_tickets_count":{"type":"number"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"completion_rate":{"type":"number"}},"required":["accuracy","average_ai_qa_score","average_evaluator_qa_score","distinct_evaluators_count","evaluation_assignment_count","total_tickets_count","subject_type","completion_rate"]}},"required":["data"]}}}}}}},"/calibration_assignments/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration assignment","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibration_items/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_id":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"ai_qa_score":{"type":"number","nullable":true},"ai_qa_evaluation":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overall_score":{"type":"number","nullable":true},"conversation_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}}},"required":["id","source","created_at","updated_at","overall_score","conversation_id","evaluator_membership_id","evaluation_assignment_id","conversation_cx_risk_snapshot_id","files","qa_agent_evaluations"]},{"type":"object","properties":{"id":{"type":"string"},"overall_score":{"type":"number","nullable":true}},"required":["id","overall_score"]},{"nullable":true}]},"human_qa_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"overall_score":{"type":"number","nullable":true},"conversation_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluation_assignment_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}},"qa_agent_evaluations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string","enum":["ai","human"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"expanded_comment":{"type":"string","nullable":true},"score_level":{"type":"string","nullable":true,"enum":["low","medium","high"]},"overall_score":{"type":"number","nullable":true},"read_at":{"type":"string","nullable":true,"format":"date-time"},"effective":{"type":"boolean"},"overridden_by_id":{"type":"string","nullable":true},"qa_evaluation_id":{"type":"string","nullable":true},"conversation_cx_risk_snapshot_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_summary":{"type":"string","nullable":true},"conversation_qa_evaluated_at":{"type":"string","nullable":true,"format":"date-time"},"conversation_ticket_status":{"type":"string","nullable":true,"enum":["open","resolved"]},"conversation_review_status":{"type":"string","nullable":true,"enum":["none","unresolved","resolved","compliance_review"]},"conversation_assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_resolver":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"conversation_interaction_type":{"type":"string","nullable":true,"enum":["sales_call","ticket"]},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"work_item_summary":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["human","bot"]},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","type","avatar_url"]},"evaluator_account":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"customers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"coaching_session":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"coached_at":{"type":"string","format":"date-time"}},"required":["id","coached_at"]},"contest":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string","nullable":true,"enum":["unresolved","resolved"]},"outcome":{"type":"string","enum":["unresolved","accepted","rejected"]},"display_outcome":{"type":"string","enum":["unresolved","accepted","partially_accepted","rejected"]},"contest_level":{"type":"integer","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"count":{"type":"integer"}},"required":["id","status","outcome","display_outcome","contest_level","created_at","updated_at","count"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"processing_status":{"type":"string"},"score":{"type":"number","nullable":true},"max_score":{"type":"number","nullable":true},"score_cap_applied":{"type":"boolean","nullable":true},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"auto_failed":{"type":"boolean"},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"condition":{"type":"string","nullable":true},"nested_criteria":{"type":"boolean"},"two_level":{"type":"boolean"},"is_primary":{"type":"boolean","nullable":true},"uses_checks":{"type":"boolean"},"status":{"type":"string"},"lock_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","condition","nested_criteria","two_level","is_primary","uses_checks","status","lock_version","created_at","updated_at"]},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"children":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number","nullable":true},"weight":{"type":"number"},"agent_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string"},"scorecard_criterion_scoring_type":{"type":"string"},"scorecard_criterion_description":{"type":"string","nullable":true},"scorecard_criterion_weight":{"type":"number"},"scorecard_criterion_max_score":{"type":"number","nullable":true},"scorecard_criterion_score_options":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]}},"selected_score_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","nullable":true},"value":{"type":"number"}},"required":["id","label","type","value"]},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"guiding_question_answers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"comment_type":{"type":"string"},"expanded_comment":{"type":"string","nullable":true},"processing_status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"author":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","full_name","email"]},"evaluation_guiding_question_answer":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"answer":{"type":"string"},"score":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"guiding_question":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"content":{"type":"string"}},"required":["id","content"]}},"required":["id","answer","score","created_at","updated_at","guiding_question"]}},"required":["id","content","comment_type","expanded_comment","processing_status","created_at","updated_at","author","evaluation_guiding_question_answer"]}},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string","enum":["feedback","knowledge_base_document"]},"knowledge_base_document_id":{"type":"string","nullable":true},"reference_evaluation_source_type":{"type":"string","nullable":true},"reference_criterion_result_id":{"type":"string","nullable":true},"reference_conversation_id":{"type":"string","nullable":true},"reference_conversation_external_id":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","reference_evaluation_source_type","reference_criterion_result_id","reference_conversation_id","reference_conversation_external_id"]}},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"qa_evaluation_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_external_created_at":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","reason","knowledge_base_answer","created_at","updated_at","score","max_score","weight","agent_id","scorecard_criterion_id","scorecard_criterion_scoring_type","scorecard_criterion_description","scorecard_criterion_weight","scorecard_criterion_max_score","scorecard_criterion_score_options","selected_score_option","selected_justification_option","guiding_question_answers","comments","knowledge_base_citations","check_results","qa_evaluation_id","scorecard_id","conversation_id","conversation_external_id","conversation_external_created_at","agent_name","children"]}}},"required":["id","created_at","updated_at","processing_status","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","auto_failed","scorecard","criterion_results"]}}},"required":["id","source","created_at","updated_at","expanded_comment","score_level","overall_score","read_at","effective","overridden_by_id","qa_evaluation_id","conversation_cx_risk_snapshot_id","conversation_id","conversation_external_id","conversation_summary","conversation_qa_evaluated_at","conversation_ticket_status","conversation_review_status","conversation_assignee","conversation_resolver","conversation_interaction_type","work_item_id","work_item_external_id","work_item_summary","agent","evaluator_account","customers","coaching_session","contest","scorecard_results"]}}},"required":["id","source","created_at","updated_at","overall_score","conversation_id","evaluator_membership_id","evaluation_assignment_id","conversation_cx_risk_snapshot_id","files","qa_agent_evaluations"]}},"evaluation_assignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]}},"ai_human_average_delta":{"type":"number","nullable":true},"human_human_average_delta":{"type":"number","nullable":true},"ai_human_alignment_score":{"type":"number","nullable":true},"human_human_alignment_score":{"type":"number","nullable":true},"evaluation_status":{"type":"string","enum":["none","pending","in_progress","completed"]},"evaluation_assignments_count":{"type":"number"},"completed_evaluation_assignments_count":{"type":"number"},"checks_count":{"type":"number"},"misaligned_checks_count":{"type":"number"},"ai_human_comparison_status":{"type":"string","enum":["not_ready","comparable","incompatible_scorecards","no_comparable_checks"]},"evaluation_batch_assignees":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"evaluation_batch_id":{"type":"string"},"evaluator_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator_name":{"type":"string"},"evaluator_email":{"type":"string"},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"last_completed_index":{"type":"number","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","evaluation_batch_id","evaluator_id","evaluator_membership_id","evaluator_name","evaluator_email","assignments_count","completed_count","last_completed_index","created_at","updated_at"]}},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","avatar_url"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","evaluation_batch_id","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","ai_qa_score","ai_qa_evaluation","human_qa_evaluations","evaluation_assignments","ai_human_average_delta","human_human_average_delta","ai_human_alignment_score","human_human_alignment_score","evaluation_status","evaluation_assignments_count","completed_evaluation_assignments_count","checks_count","misaligned_checks_count","ai_human_comparison_status","evaluation_batch_assignees","agents","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibration_items/{id}/navigation":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration item navigation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previous":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"conversation_id":{"type":"string","nullable":true}},"required":["id","conversation_id"]},"next":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"conversation_id":{"type":"string","nullable":true}},"required":["id","conversation_id"]},"position_current":{"type":"number"},"position_total":{"type":"number"},"can_navigate_previous":{"type":"boolean"},"can_navigate_next":{"type":"boolean"},"subject_type":{"type":"string","enum":["conversation","work_item"]}},"required":["previous","next","position_current","position_total","can_navigate_previous","can_navigate_next","subject_type"]}},"required":["data"]}}}}}}},"/calibrations/{id}/items/bulk_delete":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["ids"]}}}},"responses":{"200":{"description":"Calibration items deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deleted_count":{"type":"number"}},"required":["deleted_count"]}},"required":["data"]}}}}}}},"/calibrations/{id}/items/bulk_reset":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["ids"]}}}},"responses":{"200":{"description":"Completed calibration items reset","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reset_count":{"type":"number"}},"required":["reset_count"]}},"required":["data"]}}}}}}},"/calibration_assignments/{id}/reassign":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluator_membership_id":{"type":"string","minLength":1}},"required":["evaluator_membership_id"]}}}},"responses":{"200":{"description":"Calibration assignment reassigned","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]}},"required":["data"]}}}},"422":{"description":"Invalid reassignment","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibration_assignments/{id}/navigation":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Assignment navigation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previous":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]},"next":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"status":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"subject":{"type":"object","properties":{"type":{"type":"string","enum":["conversation","work_item"]},"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"work_item_type":{"type":"string"}},"required":["type","id","external_id","title"]},"conversation_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_external_id":{"type":"string","nullable":true},"evaluation_batch_id":{"type":"string"},"evaluation_batch_name":{"type":"string"},"evaluation_batch_conversation_id":{"type":"string","nullable":true},"evaluation_batch_assignee_id":{"type":"string","nullable":true},"evaluator_membership_id":{"type":"string","nullable":true},"evaluator":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string"}},"required":["id","name","email"]},"scorecard":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"qa_evaluation_id":{"type":"string","nullable":true},"score":{"type":"number","nullable":true},"assignee_assignments_count":{"type":"number","nullable":true},"assignee_completed_count":{"type":"number","nullable":true},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","subject_type","subject","conversation_id","work_item_id","conversation_external_id","work_item_external_id","evaluation_batch_id","evaluation_batch_name","evaluation_batch_conversation_id","evaluation_batch_assignee_id","evaluator_membership_id","evaluator","scorecard","qa_evaluation_id","score","assignee_assignments_count","assignee_completed_count","completed_at","created_at","updated_at"]},"position_current":{"type":"number","nullable":true},"position_total":{"type":"number"},"can_navigate_previous":{"type":"boolean"},"can_navigate_next":{"type":"boolean"}},"required":["previous","next","position_current","position_total","can_navigate_previous","can_navigate_next"]}},"required":["data"]}}}}}}},"/calibrations/{id}/archive":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibrations/{id}/activate":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Calibration updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subject_type":{"type":"string","enum":["conversation","work_item"]},"status":{"type":"string"},"selection_mode":{"type":"string","enum":["targeted","sampled"]},"assignments_count":{"type":"number"},"completed_count":{"type":"number"},"tickets_per_reviewer":{"type":"number","nullable":true},"evaluations_per_ticket":{"type":"number","nullable":true},"rotate_evaluator_pairs":{"type":"boolean"},"sampling_percentage":{"type":"number","nullable":true},"window_start_on":{"type":"string","nullable":true},"window_end_on":{"type":"string","nullable":true},"end_date":{"type":"string","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"work_item_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"window_date_type":{"type":"string","enum":["started","evaluated"]},"editable":{"type":"boolean"},"duration":{"type":"number","nullable":true},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"qa_score_levels":{"type":"array","items":{"type":"string","enum":["high","medium","low"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"assigned_zendesk_brands":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"evaluation_schedule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"}},"required":["id"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","name","subject_type","status","selection_mode","assignments_count","completed_count","tickets_per_reviewer","evaluations_per_ticket","rotate_evaluator_pairs","sampling_percentage","window_start_on","window_end_on","end_date","assigned_account_ids","conversation_ids","work_item_ids","window_date_type","editable","duration","assigned_role_ids","assigned_scorecard_ids","zendesk_brand_ids","group_ids","qa_score_levels","channels","assigned_zendesk_brands","evaluation_schedule","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_schedules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Evaluation schedules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EvaluationSchedule"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_schedule":{"type":"object","properties":{"name":{"type":"string","minLength":1},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"next_batch_window_start_on":{"type":"string","nullable":true},"tickets_per_reviewer":{"type":"integer"},"duration":{"type":"integer"},"evaluations_per_ticket":{"type":"integer","nullable":true},"rotate_evaluator_pairs":{"type":"boolean","nullable":true},"assigned_account_ids":{"type":"array","items":{"type":"string"}},"assigned_role_ids":{"type":"array","items":{"type":"string"}},"assigned_scorecard_ids":{"type":"array","items":{"type":"string"}},"zendesk_brand_ids":{"type":"array","items":{"type":"string"}},"conversation_ids":{"type":"array","items":{"type":"string"}},"group_ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}},"required":["name","frequency","tickets_per_reviewer","duration"]}},"required":["evaluation_schedule"]}}}},"responses":{"201":{"description":"Evaluation schedule created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EvaluationSchedule"}},"required":["data"]}}}},"404":{"description":"Referenced record not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid schedule","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_schedules/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Evaluation schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EvaluationSchedule"}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_schedule":{"type":"object","properties":{"name":{"type":"string"}}}},"required":["evaluation_schedule"]}}}},"responses":{"200":{"description":"Evaluation schedule updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/EvaluationSchedule"}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid schedule","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibration_items/{calibration_item_id}/reviews":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"calibration_item_id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Reviews for a calibration item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CalibrationItemReview"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"calibration_item_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_batch_conversation_review":{"type":"object","properties":{"check_result_reactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"qa_agent_evaluation_scorecard_criterion_check_result_id":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["pass","fail"]},"_destroy":{"type":"boolean","nullable":true}}}},"check_comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"_destroy":{"type":"boolean","nullable":true}}}}},"default":{}}}}}}},"responses":{"201":{"description":"Review created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalibrationItemReview"}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid review","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/calibration_items/{calibration_item_id}/reviews/{id}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"calibration_item_id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Review","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalibrationItemReview"}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"calibration_item_id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_batch_conversation_review":{"type":"object","properties":{"check_result_reactions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"qa_agent_evaluation_scorecard_criterion_check_result_id":{"type":"string","nullable":true},"type":{"type":"string","nullable":true,"enum":["pass","fail"]},"_destroy":{"type":"boolean","nullable":true}}}},"check_comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"scorecard_criterion_check_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"_destroy":{"type":"boolean","nullable":true}}}}},"default":{}}}}}}},"responses":{"200":{"description":"Review updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/CalibrationItemReview"}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid review","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"calibration_item_id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Review deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/facets/{facet}":{"get":{"parameters":[{"schema":{"type":"string","enum":["qa_score_level","review_status"]},"required":true,"name":"facet","in":"path"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"review_statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"qa_score_levels","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_before","in":"query"},{"schema":{"type":"string"},"required":false,"name":"custom_attribute_filters","in":"query"}],"responses":{"200":{"description":"Work item facet counts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"anyOf":[{"type":"string","enum":["high","medium","low","not_evaluated"]},{"type":"string","enum":["none","unresolved","resolved","compliance_review"]}]},"count":{"type":"integer"}},"required":["value","count"]}}},"required":["data"]}}}},"400":{"description":"Invalid work item filters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_types":{"get":{"responses":{"200":{"description":"Canonical work item types the caller can see, with item counts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}},"required":["value","count"]}}},"required":["data"]}}}}}}},"/work_items":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"review_statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"qa_score_levels","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_before","in":"query"},{"schema":{"type":"string"},"required":false,"name":"custom_attribute_filters","in":"query"},{"schema":{"type":"string","enum":["completed_date"],"default":"completed_date"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"}],"responses":{"200":{"description":"Work items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"review_status":{"type":"string","enum":["none","unresolved","resolved","compliance_review"]},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","membership_id","full_name","email"]},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"qa_score_effective":{"type":"number","nullable":true,"minimum":0,"maximum":1},"qa_score_level":{"type":"string","nullable":true,"enum":["high","medium","low"]},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","agent","agents","completed_at","type","status","review_status","assignee","short_description","description","qa_score_effective","qa_score_level","custom_attributes","created_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid pagination cursor","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{id}/adjacent":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"assignee_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"review_statuses","in":"query"},{"schema":{"type":"string"},"required":false,"name":"qa_score_levels","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"completed_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"imported_before","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_after","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"review_resolved_before","in":"query"},{"schema":{"type":"string"},"required":false,"name":"custom_attribute_filters","in":"query"},{"schema":{"type":"string","enum":["completed_date"],"default":"completed_date"},"required":false,"name":"ordering","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sort_direction","in":"query"}],"responses":{"200":{"description":"Adjacent work items in list order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previous_id":{"type":"string","nullable":true,"format":"uuid"},"next_id":{"type":"string","nullable":true,"format":"uuid"}},"required":["previous_id","next_id"]}},"required":["data"]}}}},"400":{"description":"Invalid work item filters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Work item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"review_status":{"type":"string","enum":["none","unresolved","resolved","compliance_review"]},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","membership_id","full_name","email"]},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"qa_score_effective":{"type":"number","nullable":true,"minimum":0,"maximum":1},"qa_score_level":{"type":"string","nullable":true,"enum":["high","medium","low"]},"qa_eligibility":{"type":"object","nullable":true,"properties":{"eligible_employee_ids":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["eligible_employee_ids","reason","expires_at"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"linked_conversations":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"linked_at":{"type":"string","format":"date-time"}},"required":["conversation_id","subject","external_id","created_at","linked_at"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","agent","agents","type","status","review_status","review_resolved_at","assignee","last_assigned_at","short_description","description","qa_score_effective","qa_score_level","qa_eligibility","completed_at","custom_attributes","events","linked_conversations","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_item":{"type":"object","properties":{"review_status":{"type":"string","enum":["none","unresolved","resolved","compliance_review"]},"assignee_id":{"type":"string","nullable":true}}}},"required":["work_item"]}}}},"responses":{"200":{"description":"Work item updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]}},"type":{"type":"string"},"status":{"type":"string","enum":["pending","in_progress","completed","cancelled"]},"review_status":{"type":"string","enum":["none","unresolved","resolved","compliance_review"]},"review_resolved_at":{"type":"string","nullable":true,"format":"date-time"},"assignee":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"full_name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","membership_id","full_name","email"]},"last_assigned_at":{"type":"string","nullable":true,"format":"date-time"},"short_description":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"qa_score_effective":{"type":"number","nullable":true,"minimum":0,"maximum":1},"qa_score_level":{"type":"string","nullable":true,"enum":["high","medium","low"]},"qa_eligibility":{"type":"object","nullable":true,"properties":{"eligible_employee_ids":{"type":"array","items":{"type":"string"}},"reason":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}},"required":["eligible_employee_ids","reason","expires_at"]},"completed_at":{"type":"string","nullable":true,"format":"date-time"},"custom_attributes":{"type":"object","additionalProperties":{"nullable":true}},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"linked_conversations":{"type":"array","items":{"type":"object","properties":{"conversation_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"linked_at":{"type":"string","format":"date-time"}},"required":["conversation_id","subject","external_id","created_at","linked_at"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","external_id","agent","agents","type","status","review_status","review_resolved_at","assignee","last_assigned_at","short_description","description","qa_score_effective","qa_score_level","qa_eligibility","completed_at","custom_attributes","events","linked_conversations","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Work item or assignee not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{id}/events/{event_id}":{"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"event_id","in":"path"}],"responses":{"200":{"description":"Work item event deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"external_id":{"type":"string"},"actor":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"avatar_url":{"type":"string","nullable":true}},"required":["id","name","email","external_id","avatar_url"]},"content":{"type":"string","nullable":true},"occurred_at":{"type":"string","nullable":true,"format":"date-time"},"deleted_at":{"type":"string","nullable":true,"format":"date-time"},"created_at":{"type":"string","format":"date-time"}},"required":["id","external_id","actor","content","occurred_at","deleted_at","created_at"]}},"required":["data"]}}}},"404":{"description":"Work item event not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_imports":{"post":{"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"}}}}}},"responses":{"201":{"description":"Work item import accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"total_rows":{"type":"integer"},"succeeded_rows":{"type":"integer"},"failed_rows":{"type":"integer"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","total_rows","succeeded_rows","failed_rows","error","created_at","updated_at"]}},"required":["data"]}}}},"413":{"description":"File too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid upload","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_imports/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Work item import","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","processing","completed","completed_with_errors","failed"]},"total_rows":{"type":"integer"},"succeeded_rows":{"type":"integer"},"failed_rows":{"type":"integer"},"error":{"type":"string","nullable":true},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","status","total_rows","succeeded_rows","failed_rows","error","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Work item import not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_attributes":{"get":{"responses":{"200":{"description":"Work item custom attributes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"value_type":{"type":"string","enum":["string","number","boolean"]}},"required":["key","label","value_type"]}}},"required":["data"]}}}}}}},"/work_item_attributes/values":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"key","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Most common values stored for one custom attribute","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}},"required":["value","count"]}}},"required":["data"]}}}}}}},"/work_items/{workItemId}/qa_evaluations":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"}],"responses":{"200":{"description":"Work item QA evaluations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"work_item_id":{"type":"string","format":"uuid"},"subject_employee_id":{"type":"string"},"source":{"type":"string","enum":["human","ai"]},"processing_status":{"type":"string","enum":["pending","completed","failed"]},"overall_score":{"type":"number","nullable":true},"active":{"type":"boolean"},"effective":{"type":"boolean"},"read_at":{"type":"string","nullable":true,"format":"date-time"},"evaluator":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["membership_id","name","email"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"selected_score_option_id":{"type":"string","nullable":true},"selected_justification_option_id":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"summary":{"type":"string"}},"required":["id","scorecard_criterion_check_id","selected_justification_option_id","result","summary"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"processing_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","content","comment_type","processing_status","created_at","updated_at","author"]}}},"required":["id","scorecard_criterion_id","score","max_score","selected_score_option_id","selected_justification_option_id","reason","check_results","comments"]}}},"required":["id","scorecard_id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","criterion_results"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","work_item_id","subject_employee_id","source","processing_status","overall_score","active","effective","read_at","evaluator","scorecard_results","created_at","updated_at"]}}},"required":["data"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"scorecard_results":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string","minLength":1},"criterion_results":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string","minLength":1},"score":{"type":"number","minimum":0},"max_score":{"type":"number","minimum":0},"selected_score_option_id":{"type":"string","nullable":true,"minLength":1},"selected_justification_option_id":{"type":"string","nullable":true,"minLength":1},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_check_id":{"type":"string","minLength":1},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"selected_justification_option_id":{"type":"string","nullable":true,"minLength":1},"summary":{"type":"string"}},"required":["scorecard_criterion_check_id","result"]}}},"required":["scorecard_criterion_id","score","max_score"]},"minItems":1}},"required":["scorecard_id","criterion_results"]},"minItems":1}},"required":["scorecard_results"]},"evaluation_assignment_id":{"type":"string"},"subject_employee_id":{"type":"string"}},"required":["qa_evaluation"]}}}},"responses":{"201":{"description":"Work item QA evaluation created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"work_item_id":{"type":"string","format":"uuid"},"subject_employee_id":{"type":"string"},"source":{"type":"string","enum":["human","ai"]},"processing_status":{"type":"string","enum":["pending","completed","failed"]},"overall_score":{"type":"number","nullable":true},"active":{"type":"boolean"},"effective":{"type":"boolean"},"read_at":{"type":"string","nullable":true,"format":"date-time"},"evaluator":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["membership_id","name","email"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"selected_score_option_id":{"type":"string","nullable":true},"selected_justification_option_id":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"summary":{"type":"string"}},"required":["id","scorecard_criterion_check_id","selected_justification_option_id","result","summary"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"processing_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","content","comment_type","processing_status","created_at","updated_at","author"]}}},"required":["id","scorecard_criterion_id","score","max_score","selected_score_option_id","selected_justification_option_id","reason","check_results","comments"]}}},"required":["id","scorecard_id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","criterion_results"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","work_item_id","subject_employee_id","source","processing_status","overall_score","active","effective","read_at","evaluator","scorecard_results","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{workItemId}/ai_qa_evaluation":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"subject_employee_id","in":"query"}],"responses":{"200":{"description":"Latest AI work item QA evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string","minLength":1},"work_item_id":{"type":"string","format":"uuid"},"subject_employee_id":{"type":"string"},"source":{"type":"string","enum":["human","ai"]},"processing_status":{"type":"string","enum":["pending","completed","failed"]},"overall_score":{"type":"number","nullable":true},"active":{"type":"boolean"},"effective":{"type":"boolean"},"read_at":{"type":"string","nullable":true,"format":"date-time"},"evaluator":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["membership_id","name","email"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"selected_score_option_id":{"type":"string","nullable":true},"selected_justification_option_id":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"summary":{"type":"string"}},"required":["id","scorecard_criterion_check_id","selected_justification_option_id","result","summary"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"processing_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","content","comment_type","processing_status","created_at","updated_at","author"]}}},"required":["id","scorecard_criterion_id","score","max_score","selected_score_option_id","selected_justification_option_id","reason","check_results","comments"]}}},"required":["id","scorecard_id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","criterion_results"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","work_item_id","subject_employee_id","source","processing_status","overall_score","active","effective","read_at","evaluator","scorecard_results","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"}],"responses":{"202":{"description":"AI work item QA evaluation requested","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"work_item_id":{"type":"string","format":"uuid"},"subject_employee_id":{"type":"string"},"source":{"type":"string","enum":["human","ai"]},"processing_status":{"type":"string","enum":["pending","completed","failed"]},"overall_score":{"type":"number","nullable":true},"active":{"type":"boolean"},"effective":{"type":"boolean"},"read_at":{"type":"string","nullable":true,"format":"date-time"},"evaluator":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["membership_id","name","email"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"selected_score_option_id":{"type":"string","nullable":true},"selected_justification_option_id":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"summary":{"type":"string"}},"required":["id","scorecard_criterion_check_id","selected_justification_option_id","result","summary"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"processing_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","content","comment_type","processing_status","created_at","updated_at","author"]}}},"required":["id","scorecard_criterion_id","score","max_score","selected_score_option_id","selected_justification_option_id","reason","check_results","comments"]}}},"required":["id","scorecard_id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","criterion_results"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","work_item_id","subject_employee_id","source","processing_status","overall_score","active","effective","read_at","evaluator","scorecard_results","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"AI evaluation cannot be requested","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_item_qa_evaluations/{evaluationId}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"evaluationId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qa_evaluation":{"type":"object","properties":{"scorecard_results":{"type":"array","items":{"type":"object","properties":{"scorecard_id":{"type":"string","minLength":1},"criterion_results":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_id":{"type":"string","minLength":1},"score":{"type":"number","minimum":0},"max_score":{"type":"number","minimum":0},"selected_score_option_id":{"type":"string","nullable":true,"minLength":1},"selected_justification_option_id":{"type":"string","nullable":true,"minLength":1},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"scorecard_criterion_check_id":{"type":"string","minLength":1},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"selected_justification_option_id":{"type":"string","nullable":true,"minLength":1},"summary":{"type":"string"}},"required":["scorecard_criterion_check_id","result"]}}},"required":["scorecard_criterion_id","score","max_score"]},"minItems":1}},"required":["scorecard_id","criterion_results"]},"minItems":1}},"required":["scorecard_results"]}},"required":["qa_evaluation"]}}}},"responses":{"200":{"description":"Work item QA evaluation updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","minLength":1},"work_item_id":{"type":"string","format":"uuid"},"subject_employee_id":{"type":"string"},"source":{"type":"string","enum":["human","ai"]},"processing_status":{"type":"string","enum":["pending","completed","failed"]},"overall_score":{"type":"number","nullable":true},"active":{"type":"boolean"},"effective":{"type":"boolean"},"read_at":{"type":"string","nullable":true,"format":"date-time"},"evaluator":{"type":"object","nullable":true,"properties":{"membership_id":{"type":"string","format":"uuid"},"name":{"type":"string"},"email":{"type":"string"}},"required":["membership_id","name","email"]},"scorecard_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"score_cap_applied":{"type":"boolean"},"score_cap_value":{"type":"number","nullable":true},"score_before_cap":{"type":"number","nullable":true},"score_cap_reason":{"type":"string","nullable":true},"score_cap_criterion_id":{"type":"string","nullable":true},"criterion_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_id":{"type":"string"},"score":{"type":"number"},"max_score":{"type":"number"},"selected_score_option_id":{"type":"string","nullable":true},"selected_justification_option_id":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"check_results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"scorecard_criterion_check_id":{"type":"string"},"selected_justification_option_id":{"type":"string","nullable":true},"result":{"type":"string","enum":["passed","failed","not_applicable","partial"]},"summary":{"type":"string"}},"required":["id","scorecard_criterion_check_id","selected_justification_option_id","result","summary"]}},"comments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1},"content":{"type":"string","nullable":true},"comment_type":{"type":"string","enum":["positive","negative"]},"processing_status":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"author":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"}},"required":["id","full_name","email"]}},"required":["id","content","comment_type","processing_status","created_at","updated_at","author"]}}},"required":["id","scorecard_criterion_id","score","max_score","selected_score_option_id","selected_justification_option_id","reason","check_results","comments"]}}},"required":["id","scorecard_id","score","max_score","score_cap_applied","score_cap_value","score_before_cap","score_cap_reason","score_cap_criterion_id","criterion_results"]}},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"}},"required":["id","work_item_id","subject_employee_id","source","processing_status","overall_score","active","effective","read_at","evaluator","scorecard_results","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Evaluation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid evaluation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_items/{workItemId}/applicable_scorecards":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"workItemId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"subject_employee_id","in":"query"}],"responses":{"200":{"description":"Published scorecards applicable to the work item agent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}},"required":["data"]}}}},"404":{"description":"Work item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/task-notifications":{"get":{"parameters":[{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"unread","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"List notifications for the current member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"objectType":{"type":"string","enum":["task","conversation","manual_qa_evaluation_submission"]},"objectId":{"type":"string"},"type":{"type":"string","enum":["task_assigned","conversation_assigned","evaluation_feedback_received"]},"title":{"type":"string"},"description":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"readAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","objectType","objectId","type","title","description","metadata","readAt","createdAt"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}}}}},"/task-notifications/unread-count":{"get":{"responses":{"200":{"description":"Unread notification count","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"count":{"type":"integer"}},"required":["count"]}},"required":["data"]}}}}}}},"/task-notifications/{id}/read":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Mark a notification as read","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"objectType":{"type":"string","enum":["task","conversation","manual_qa_evaluation_submission"]},"objectId":{"type":"string"},"type":{"type":"string","enum":["task_assigned","conversation_assigned","evaluation_feedback_received"]},"title":{"type":"string"},"description":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"readAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","objectType","objectId","type","title","description","metadata","readAt","createdAt"]}},"required":["data"]}}}},"404":{"description":"Notification not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/task-notifications/mark-all-read":{"post":{"responses":{"200":{"description":"Mark all notifications as read","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"updatedCount":{"type":"integer"}},"required":["updatedCount"]}},"required":["data"]}}}}}}},"/suggested-agents":{"get":{"responses":{"200":{"description":"Live managed-agent suggestions for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"category":{"type":"string","enum":["customer_service","fraud","risk"]},"emoji":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"reason":{"type":"string"},"prompt":{"type":"string"},"position":{"type":"number"}},"required":["id","category","emoji","title","description","reason","prompt","position"]}}},"required":["data"]}}}}}}},"/suggested-agents/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Suggested agent deleted"},"404":{"description":"Suggested agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla/outcomes":{"get":{"parameters":[{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter","in":"query"},{"schema":{"type":"string","enum":["live","weekly"],"default":"live"},"required":false,"name":"source","in":"query"}],"responses":{"200":{"description":"SLA target outcomes found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"conversation_id":{"type":"string"},"conversation_prefix_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"conversation_jira_issue_key":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"conversation_priority":{"type":"string","nullable":true,"enum":["none","low","normal","high","urgent"]},"sla_policy_id":{"type":"string"},"policy":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","name"]},"metric":{"type":"string"},"breach_type":{"type":"string","nullable":true},"status":{"type":"string"},"target_started_at":{"type":"string"},"deadline_at":{"type":"string"},"satisfied_at":{"type":"string","nullable":true},"outcome_at":{"type":"string"},"paused_seconds":{"type":"integer","minimum":0},"source_channel":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true},"workload_context":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string"},"mention_id":{"type":"string"},"name":{"type":"string"}},"required":["id","mention_id","name"]},"assigned_at":{"type":"string"},"at_assignment":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_target_start":{"type":"object","nullable":true,"properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]},"at_breach":{"type":"object","properties":{"observed_at":{"type":"string"},"assigned_email_count":{"type":"integer","minimum":0},"active_chat_count":{"type":"integer","minimum":0},"active_call_count":{"type":"integer","nullable":true,"minimum":0}},"required":["observed_at","assigned_email_count","active_chat_count","active_call_count"]}},"required":["agent","assigned_at","at_assignment","at_target_start","at_breach"]}},"required":["id","conversation_id","conversation_prefix_id","conversation_external_id","conversation_jira_issue_key","conversation_subject","conversation_priority","sla_policy_id","policy","metric","breach_type","status","target_started_at","deadline_at","satisfied_at","outcome_at","paused_seconds","source_channel","organization_data_source_id","workload_context"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/sla/outcomes/check":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"rails_organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["conversation_id","rails_organization_id"]}}}},"responses":{"202":{"description":"SLA outcome check enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/sla/outcomes/recalculate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1},"conversation_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"mode":{"type":"string","enum":["pending","all"],"default":"pending"},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":200000},"delete_stale":{"type":"boolean","default":true}},"required":["organization_id"],"additionalProperties":false}}}},"responses":{"202":{"description":"SLA outcome recalculation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"run_id":{"type":"string"},"job_id":{"type":"string"},"queue":{"type":"string","enum":["check","detect"]},"rails_organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"conversation_id":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"mode":{"type":"string","nullable":true,"enum":["pending","all"]},"limit":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"delete_stale":{"type":"boolean"}},"required":["run_id","job_id","queue","rails_organization_id","conversation_id","mode","limit","delete_stale"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/sla/outcomes/recalculate/{jobId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"jobId","in":"path"},{"schema":{"type":"string","enum":["check","detect"],"default":"detect"},"required":false,"name":"queue","in":"query"}],"responses":{"200":{"description":"SLA outcome recalculation job status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"job_id":{"type":"string"},"queue":{"type":"string","enum":["check","detect"]},"state":{"type":"string"},"progress":{"nullable":true},"return_value":{"nullable":true},"failed_reason":{"type":"string","nullable":true},"attempts_made":{"type":"integer"},"timestamp":{"type":"number","nullable":true},"processed_on":{"type":"number","nullable":true},"finished_on":{"type":"number","nullable":true}},"required":["job_id","queue","state","failed_reason","attempts_made","timestamp","processed_on","finished_on"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Job not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/sla/outcomes/detect":{"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"rails_organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":10000},"mode":{"type":"string","enum":["pending","all"]},"conversation_id_after":{"type":"integer","minimum":0,"exclusiveMinimum":true}}}}}},"responses":{"202":{"description":"SLA outcome detection enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/maintenance/tasks":{"get":{"responses":{"200":{"description":"Registered maintenance tasks","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"group":{"type":"string"},"params":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["string","number","boolean","enum"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"defaultValue":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"placeholder":{"type":"string"},"description":{"type":"string"}},"required":["name","label","type"]}}},"required":["id","name","description","params"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/maintenance/tasks/{taskId}/run":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"taskId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"args":{"type":"object","additionalProperties":{"nullable":true}}}}}}},"responses":{"202":{"description":"Maintenance task run enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"run_id":{"type":"string"},"job_id":{"type":"string"},"task_id":{"type":"string"}},"required":["run_id","job_id","task_id"]}},"required":["data"]}}}},"400":{"description":"Invalid arguments","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Task not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/maintenance/runs/{jobId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Maintenance task run status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"job_id":{"type":"string"},"task_id":{"type":"string","nullable":true},"state":{"type":"string"},"progress":{"nullable":true},"return_value":{"nullable":true},"failed_reason":{"type":"string","nullable":true},"attempts_made":{"type":"integer"},"timestamp":{"type":"number","nullable":true},"processed_on":{"type":"number","nullable":true},"finished_on":{"type":"number","nullable":true}},"required":["job_id","task_id","state","failed_reason","attempts_made","timestamp","processed_on","finished_on"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/bot-topic-eval-datasets/exports":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"string","minLength":1},"count":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100000},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"dry_run":{"type":"boolean"}},"required":["organization_id","count","from","to"],"additionalProperties":false}}}},"responses":{"202":{"description":"Evaluation dataset export enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"job_id":{"type":"string"},"run_id":{"type":"string"},"rails_organization_id":{"type":"integer"},"dataset_id":{"type":"string"},"count":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"seed":{"type":"string"},"dry_run":{"type":"boolean"},"state":{"type":"string"},"progress":{"nullable":true},"result":{"nullable":true},"failed_reason":{"type":"string","nullable":true},"attempts_made":{"type":"integer"},"queued_at":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true}},"required":["job_id","run_id","rails_organization_id","dataset_id","count","from","to","seed","dry_run","state","failed_reason","attempts_made","queued_at","started_at","finished_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Recent evaluation dataset exports","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"run_id":{"type":"string"},"rails_organization_id":{"type":"integer"},"dataset_id":{"type":"string"},"count":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"seed":{"type":"string"},"dry_run":{"type":"boolean"},"state":{"type":"string"},"progress":{"nullable":true},"result":{"nullable":true},"failed_reason":{"type":"string","nullable":true},"attempts_made":{"type":"integer"},"queued_at":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true}},"required":["job_id","run_id","rails_organization_id","dataset_id","count","from","to","seed","dry_run","state","failed_reason","attempts_made","queued_at","started_at","finished_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/bot-topic-eval-datasets/exports/{jobId}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Evaluation dataset export status","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"job_id":{"type":"string"},"run_id":{"type":"string"},"rails_organization_id":{"type":"integer"},"dataset_id":{"type":"string"},"count":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"seed":{"type":"string"},"dry_run":{"type":"boolean"},"state":{"type":"string"},"progress":{"nullable":true},"result":{"nullable":true},"failed_reason":{"type":"string","nullable":true},"attempts_made":{"type":"integer"},"queued_at":{"type":"string","nullable":true},"started_at":{"type":"string","nullable":true},"finished_at":{"type":"string","nullable":true}},"required":["job_id","run_id","rails_organization_id","dataset_id","count","from","to","seed","dry_run","state","failed_reason","attempts_made","queued_at","started_at","finished_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/bot-topic-eval-datasets/exports/{jobId}/download/{file}":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"jobId","in":"path"},{"schema":{"type":"string","enum":["dataset","manifest"]},"required":true,"name":"file","in":"path"}],"responses":{"200":{"description":"Completed private dataset artifact","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Export not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Export has no completed artifact","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/mcp_tool_calls":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"organization","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"membership_id","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"subject","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"tool_name","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"client_id","in":"query"},{"schema":{"type":"string","enum":["ok","error"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"MCP tool calls across organizations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tool_name":{"type":"string"},"status":{"type":"string","enum":["ok","error"]},"direction":{"type":"string"},"client_id":{"type":"string"},"duration_ms":{"type":"number"},"error_type":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"response_content_count":{"type":"number","nullable":true},"created_at":{"type":"string"},"caller":{"type":"object","properties":{"subject":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"membership_id":{"type":"string","nullable":true}},"required":["subject","email","name","membership_id"]},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]}},"required":["id","tool_name","status","direction","client_id","duration_ms","error_type","error_message","response_content_count","created_at","caller","organization"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/mcp_tool_calls/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"MCP tool call with full arguments and response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"tool_name":{"type":"string"},"status":{"type":"string","enum":["ok","error"]},"direction":{"type":"string"},"client_id":{"type":"string"},"duration_ms":{"type":"number"},"error_type":{"type":"string","nullable":true},"error_message":{"type":"string","nullable":true},"response_content_count":{"type":"number","nullable":true},"created_at":{"type":"string"},"caller":{"type":"object","properties":{"subject":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"membership_id":{"type":"string","nullable":true}},"required":["subject","email","name","membership_id"]},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]},"scopes":{"type":"array","items":{"type":"string"}},"method_name":{"type":"string"},"server_name":{"type":"string"},"workos_organization_id":{"type":"string"},"rails_organization_id":{"type":"number"},"token_issued_at":{"type":"string","nullable":true},"token_expires_at":{"type":"string","nullable":true},"arguments":{"nullable":true},"response":{"nullable":true}},"required":["id","tool_name","status","direction","client_id","duration_ms","error_type","error_message","response_content_count","created_at","caller","organization","scopes","method_name","server_name","workos_organization_id","rails_organization_id","token_issued_at","token_expires_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/chats":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"organization","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"membership_id","in":"query"},{"schema":{"type":"string","enum":["agent","assistant_event","compliance_test","onboarding_list"]},"required":false,"name":"owner_type","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Chats across all organizations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"message_count":{"type":"number"},"archived_at":{"type":"string","nullable":true},"pinned_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"member":{"type":"object","properties":{"membership_id":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["membership_id","email","name"]},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]}},"required":["id","title","owner_type","owner_id","message_count","archived_at","pinned_at","created_at","updated_at","member","organization"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/chats/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Chat with its full message thread","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"chat":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"message_count":{"type":"number"},"archived_at":{"type":"string","nullable":true},"pinned_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"member":{"type":"object","properties":{"membership_id":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["membership_id","email","name"]},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]}},"required":["id","title","owner_type","owner_id","message_count","archived_at","pinned_at","created_at","updated_at","member","organization"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"parts":{"nullable":true},"tool_call_timings":{"nullable":true},"position":{"type":"number"},"created_at":{"type":"string"}},"required":["id","role","position","created_at"]}}},"required":["chat","messages"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/chat_digest_runs":{"get":{"parameters":[{"schema":{"type":"string","enum":["daily","weekly"]},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"region","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"delivered","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Instruct chat digest runs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"region":{"type":"string"},"headline":{"type":"string"},"session_count":{"type":"number"},"period_start":{"type":"string"},"period_end":{"type":"string"},"email_sent_at":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","kind","region","headline","session_count","period_start","period_end","email_sent_at","created_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"limit":{"type":"number"},"offset":{"type":"number"}},"required":["limit","offset"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/chat_digest_runs/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Digest run with rendered markdown and analysis payload","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string"},"region":{"type":"string"},"headline":{"type":"string"},"session_count":{"type":"number"},"period_start":{"type":"string"},"period_end":{"type":"string"},"email_sent_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"markdown":{"type":"string"},"analysis_data":{"nullable":true}},"required":["id","kind","region","headline","session_count","period_start","period_end","email_sent_at","created_at","markdown"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/observability/organizations":{"get":{"responses":{"200":{"description":"Organizations with chat or MCP activity","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"chat_count":{"type":"number"},"mcp_tool_call_count":{"type":"number"},"last_activity_at":{"type":"string","nullable":true}},"required":["id","slug","name","chat_count","mcp_tool_call_count","last_activity_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/observability/members":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"organization","in":"query"}],"responses":{"200":{"description":"Members with chat or MCP activity","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"email":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"chat_count":{"type":"number"},"mcp_tool_call_count":{"type":"number"}},"required":["membership_id","email","name","chat_count","mcp_tool_call_count"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/observability/mcp_tool_names":{"get":{"responses":{"200":{"description":"MCP tool names that have been called","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"tool_name":{"type":"string"},"call_count":{"type":"number"}},"required":["tool_name","call_count"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/slack/organizations":{"get":{"responses":{"200":{"description":"Organizations with synced Slack channels","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"channel_count":{"type":"number"},"message_count":{"type":"number"},"last_message_at":{"type":"string","nullable":true}},"required":["id","slug","name","channel_count","message_count","last_message_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/slack/channels":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":false,"name":"organization","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"include_archived","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Synced Slack channels across all organizations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slack_channel_id":{"type":"string"},"slack_team_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"is_private":{"type":"boolean"},"is_archived":{"type":"boolean"},"is_member":{"type":"boolean"},"num_members":{"type":"number","nullable":true},"message_count":{"type":"number"},"last_message_at":{"type":"string","nullable":true},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]},"connection":{"type":"object","properties":{"id":{"type":"string"},"account_name":{"type":"string","nullable":true}},"required":["id","account_name"]}},"required":["id","slack_channel_id","slack_team_id","name","is_private","is_archived","is_member","num_members","message_count","last_message_at","organization","connection"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/slack/channels/{id}/messages":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"One page of a channel transcript, oldest message first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"channel":{"type":"object","properties":{"id":{"type":"string"},"slack_channel_id":{"type":"string"},"slack_team_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"is_private":{"type":"boolean"},"is_archived":{"type":"boolean"},"is_member":{"type":"boolean"},"num_members":{"type":"number","nullable":true},"message_count":{"type":"number"},"last_message_at":{"type":"string","nullable":true},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]},"connection":{"type":"object","properties":{"id":{"type":"string"},"account_name":{"type":"string","nullable":true}},"required":["id","account_name"]}},"required":["id","slack_channel_id","slack_team_id","name","is_private","is_archived","is_member","num_members","message_count","last_message_at","organization","connection"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slack_message_ts":{"type":"string"},"slack_thread_ts":{"type":"string"},"is_thread_reply":{"type":"boolean"},"reply_count":{"type":"number"},"message_at":{"type":"string","nullable":true},"text":{"type":"string"},"message_type":{"type":"string"},"subtype":{"type":"string","nullable":true},"direction":{"type":"string"},"source":{"type":"string"},"outbound_source":{"type":"string","nullable":true},"author":{"type":"object","properties":{"slack_user_id":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"real_name":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"is_bot":{"type":"boolean"},"bot_id":{"type":"string","nullable":true}},"required":["slack_user_id","display_name","real_name","username","email","is_bot","bot_id"]}},"required":["id","slack_message_ts","slack_thread_ts","is_thread_reply","reply_count","message_at","text","message_type","subtype","direction","source","outbound_source","author"]}}},"required":["channel","messages"]},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"number"}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/slack/channels/{id}/threads/{thread_ts}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1},"required":true,"name":"thread_ts","in":"path"}],"responses":{"200":{"description":"A thread parent with its replies, oldest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"channel":{"type":"object","properties":{"id":{"type":"string"},"slack_channel_id":{"type":"string"},"slack_team_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"is_private":{"type":"boolean"},"is_archived":{"type":"boolean"},"is_member":{"type":"boolean"},"num_members":{"type":"number","nullable":true},"message_count":{"type":"number"},"last_message_at":{"type":"string","nullable":true},"organization":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string","nullable":true}},"required":["id","slug","name"]},"connection":{"type":"object","properties":{"id":{"type":"string"},"account_name":{"type":"string","nullable":true}},"required":["id","account_name"]}},"required":["id","slack_channel_id","slack_team_id","name","is_private","is_archived","is_member","num_members","message_count","last_message_at","organization","connection"]},"messages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slack_message_ts":{"type":"string"},"slack_thread_ts":{"type":"string"},"is_thread_reply":{"type":"boolean"},"reply_count":{"type":"number"},"message_at":{"type":"string","nullable":true},"text":{"type":"string"},"message_type":{"type":"string"},"subtype":{"type":"string","nullable":true},"direction":{"type":"string"},"source":{"type":"string"},"outbound_source":{"type":"string","nullable":true},"author":{"type":"object","properties":{"slack_user_id":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"real_name":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"is_bot":{"type":"boolean"},"bot_id":{"type":"string","nullable":true}},"required":["slack_user_id","display_name","real_name","username","email","is_bot","bot_id"]}},"required":["id","slack_message_ts","slack_thread_ts","is_thread_reply","reply_count","message_at","text","message_type","subtype","direction","source","outbound_source","author"]}}},"required":["channel","messages"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/holiday-calendars":{"get":{"responses":{"200":{"description":"List holiday calendars","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"countryCode":{"type":"string","pattern":"^[A-Za-z]{2}$"},"subdivisionCode":{"type":"string","nullable":true,"minLength":1}},"required":["name","countryCode"]}}}},"responses":{"201":{"description":"Holiday calendar created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/holiday-calendars/options":{"get":{"responses":{"200":{"description":"Holiday calendar country and subdivision options","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"countries":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"},"subdivisions":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string"}},"required":["code","name"]}}},"required":["code","name","subdivisions"]}}},"required":["countries"]}},"required":["data"]}}}}}}},"/holiday-calendars/preview":{"get":{"parameters":[{"schema":{"type":"string","pattern":"^[A-Za-z]{2}$"},"required":true,"name":"countryCode","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"subdivisionCode","in":"query"},{"schema":{"type":"integer","minimum":1900,"maximum":2200},"required":false,"name":"year","in":"query"}],"responses":{"200":{"description":"Preview imported public holidays","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"year":{"type":"number"},"holidays":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"name":{"type":"string"}},"required":["date","name"]}}},"required":["year","holidays"]}},"required":["data"]}}}}}}},"/holiday-calendars/{id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}},"responses":{"200":{"description":"Holiday calendar updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Holiday calendar not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Holiday calendar discarded"},"404":{"description":"Holiday calendar not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/holiday-calendars/{id}/holidays":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string","minLength":1}},"required":["date","name"]}}}},"responses":{"201":{"description":"Manual holiday created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Holiday calendar not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/holiday-calendars/{calendarId}/holidays/{holidayId}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"calendarId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"holidayId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}},"responses":{"200":{"description":"Holiday updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Holiday not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"calendarId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"holidayId","in":"path"}],"responses":{"200":{"description":"Holiday discarded","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"countryCode":{"type":"string"},"subdivisionCode":{"type":"string","nullable":true},"linkedWorkScheduleIds":{"type":"array","items":{"type":"string"}},"holidays":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"name":{"type":"string"},"source":{"type":"string","enum":["imported","manual"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","date","name","source","createdAt","updatedAt"]}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","countryCode","subdivisionCode","linkedWorkScheduleIds","holidays","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Holiday not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work-schedules/{workScheduleId}/holiday-calendar":{"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"workScheduleId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["holidayCalendarId"]}}}},"responses":{"200":{"description":"Work schedule holiday calendar link updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"workScheduleId":{"type":"string"},"holidayCalendarId":{"type":"string","nullable":true}},"required":["workScheduleId","holidayCalendarId"]}},"required":["data"]}}}},"404":{"description":"Work schedule or holiday calendar not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations":{"get":{"responses":{"200":{"description":"List saved SLA calculations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]},"lastResult":{"type":"object","nullable":true,"properties":{"fromWeekStartDate":{"type":"string"},"toWeekStartDate":{"type":"string"},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"slaRate":{"type":"number","nullable":true},"tickets":{"type":"number"},"inSla":{"type":"number"}},"required":["key","name","slaRate","tickets","inSla"]}}},"required":["fromWeekStartDate","toWeekStartDate","configurations"]},"lastCalculatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","definition","lastResult","lastCalculatedAt","createdAt","updatedAt"]}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]}},"required":["name","definition"]}}}},"responses":{"201":{"description":"Saved SLA calculation created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]},"lastResult":{"type":"object","nullable":true,"properties":{"fromWeekStartDate":{"type":"string"},"toWeekStartDate":{"type":"string"},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"slaRate":{"type":"number","nullable":true},"tickets":{"type":"number"},"inSla":{"type":"number"}},"required":["key","name","slaRate","tickets","inSla"]}}},"required":["fromWeekStartDate","toWeekStartDate","configurations"]},"lastCalculatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","definition","lastResult","lastCalculatedAt","createdAt","updatedAt"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/options":{"get":{"responses":{"200":{"description":"Choices for the calculation form","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"label":{"type":"string"}},"required":["id","label"]}},"statuses":{"type":"array","items":{"type":"string"}},"workSchedules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"timezone":{"type":"string"}},"required":["id","name","timezone"]}},"holidayCalendars":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}}},"required":["fields","statuses","workSchedules","holidayCalendars"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/field-values":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":true,"name":"fieldId","in":"query"}],"responses":{"200":{"description":"Most common values of a conversation field","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Saved SLA calculation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]},"lastResult":{"type":"object","nullable":true,"properties":{"fromWeekStartDate":{"type":"string"},"toWeekStartDate":{"type":"string"},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"slaRate":{"type":"number","nullable":true},"tickets":{"type":"number"},"inSla":{"type":"number"}},"required":["key","name","slaRate","tickets","inSla"]}}},"required":["fromWeekStartDate","toWeekStartDate","configurations"]},"lastCalculatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","definition","lastResult","lastCalculatedAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]}},"required":["name","definition"]}}}},"responses":{"200":{"description":"Saved SLA calculation updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"definition":{"type":"object","properties":{"reportingPeriod":{"type":"object","properties":{"type":{"type":"string","enum":["last_completed_weeks"]},"weeks":{"type":"integer","minimum":1,"maximum":52}},"required":["type","weeks"]},"cutoffHoursAfterCohortEnd":{"type":"number","nullable":true,"minimum":0},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"resolvedStatuses":{"type":"array","items":{"type":"string"},"minItems":1},"displayFields":{"type":"object","properties":{"issueTypeFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"priorityFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"agentFieldId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true}},"required":["issueTypeFieldId","priorityFieldId","agentFieldId"]},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"targetHours":{"type":"number","minimum":0,"exclusiveMinimum":true},"clock":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["calendar"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["business_hours"]},"workScheduleId":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"type":"integer","minimum":0},"minItems":2,"maxItems":2}},"label":{"type":"string","minLength":1},"holidayCalendarId":{"type":"string","nullable":true,"format":"uuid"}},"required":["type","workScheduleId","intervals","label","holidayCalendarId"]}]},"pauseStatuses":{"type":"array","items":{"type":"string"}},"include":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]}},"exclude":{"type":"array","items":{"type":"object","properties":{"conditions":{"type":"array","items":{"type":"object","properties":{"attribute":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["conversation_field"]},"fieldId":{"type":"integer","minimum":0,"exclusiveMinimum":true},"label":{"type":"string","minLength":1}},"required":["type","fieldId","label"]},{"type":"object","properties":{"type":{"type":"string","enum":["status_at_cutoff"]}},"required":["type"]}]},"operator":{"type":"string","enum":["is","is_not","is_any_of","does_not_include","contains"]},"values":{"type":"array","items":{"type":"string"},"minItems":1}},"required":["attribute","operator","values"]},"minItems":1}},"required":["conditions"]}}},"required":["key","name","targetHours","clock","pauseStatuses","include","exclude"]},"minItems":1}},"required":["cutoffHoursAfterCohortEnd","unresolvedAtCutoff","resolvedStatuses","displayFields","configurations"]},"lastResult":{"type":"object","nullable":true,"properties":{"fromWeekStartDate":{"type":"string"},"toWeekStartDate":{"type":"string"},"configurations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"slaRate":{"type":"number","nullable":true},"tickets":{"type":"number"},"inSla":{"type":"number"}},"required":["key","name","slaRate","tickets","inSla"]}}},"required":["fromWeekStartDate","toWeekStartDate","configurations"]},"lastCalculatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","definition","lastResult","lastCalculatedAt","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Saved SLA calculation deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}/results":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"fromWeekStartDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"toWeekStartDate","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"configurationKey","in":"query"}],"responses":{"200":{"description":"Results of the latest stored run for the reporting period (or the given range), computed from ticket timelines when no run exists yet","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"engineVersion":{"type":"string"},"dataAsOf":{"type":"string"},"timezone":{"type":"string"},"weekStartDay":{"type":"number"},"fromWeekStartDate":{"type":"string"},"toWeekStartDate":{"type":"string"},"latestCompletedWeekStartDate":{"type":"string"},"configurationKey":{"type":"string"},"configurationName":{"type":"string"},"clockDescription":{"type":"string"},"unresolvedAtCutoff":{"type":"string","enum":["out_of_sla","excluded"]},"headline":{"type":"object","properties":{"tickets":{"type":"number"},"inSla":{"type":"number"},"outOfSla":{"type":"number"},"breached":{"type":"number"},"pending":{"type":"number"},"slaRate":{"type":"number","nullable":true},"counterpartRate":{"type":"number","nullable":true},"avgResolutionSeconds":{"type":"number","nullable":true}},"required":["tickets","inSla","outOfSla","breached","pending","slaRate","counterpartRate","avgResolutionSeconds"]},"weeks":{"type":"array","items":{"type":"object","properties":{"tickets":{"type":"number"},"inSla":{"type":"number"},"outOfSla":{"type":"number"},"breached":{"type":"number"},"pending":{"type":"number"},"slaRate":{"type":"number","nullable":true},"counterpartRate":{"type":"number","nullable":true},"avgResolutionSeconds":{"type":"number","nullable":true},"weekStartDate":{"type":"string"},"cutoffAt":{"type":"string"}},"required":["tickets","inSla","outOfSla","breached","pending","slaRate","counterpartRate","avgResolutionSeconds","weekStartDate","cutoffAt"]}},"agents":{"type":"array","items":{"type":"object","properties":{"tickets":{"type":"number"},"inSla":{"type":"number"},"outOfSla":{"type":"number"},"breached":{"type":"number"},"pending":{"type":"number"},"slaRate":{"type":"number","nullable":true},"counterpartRate":{"type":"number","nullable":true},"avgResolutionSeconds":{"type":"number","nullable":true},"agent":{"type":"string","nullable":true}},"required":["tickets","inSla","outOfSla","breached","pending","slaRate","counterpartRate","avgResolutionSeconds","agent"]}},"agentWeeks":{"type":"array","items":{"type":"object","properties":{"agent":{"type":"string","nullable":true},"weeks":{"type":"array","items":{"type":"object","properties":{"weekStartDate":{"type":"string"},"tickets":{"type":"number"},"inSla":{"type":"number"},"slaRate":{"type":"number","nullable":true}},"required":["weekStartDate","tickets","inSla","slaRate"]}}},"required":["agent","weeks"]}},"tickets":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"number"},"key":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"weekStartDate":{"type":"string"},"createdAt":{"type":"string"},"cutoffAt":{"type":"string"},"statusAtCutoff":{"type":"string","nullable":true},"resolvedAtCutoff":{"type":"string","nullable":true},"resolvedToDate":{"type":"string","nullable":true},"agent":{"type":"string","nullable":true},"issueType":{"type":"string","nullable":true},"priority":{"type":"string","nullable":true},"countedSeconds":{"type":"number"},"pausedSeconds":{"type":"number"},"outsideScheduleSeconds":{"type":"number"},"targetSeconds":{"type":"number"},"outcome":{"type":"string","enum":["met","breached","pending"]}},"required":["conversationId","key","url","subject","weekStartDate","createdAt","cutoffAt","statusAtCutoff","resolvedAtCutoff","resolvedToDate","agent","issueType","priority","countedSeconds","pausedSeconds","outsideScheduleSeconds","targetSeconds","outcome"]}},"excluded":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"number"},"key":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"weekStartDate":{"type":"string"},"createdAt":{"type":"string"},"statusAtCutoff":{"type":"string","nullable":true},"reason":{"type":"string"}},"required":["conversationId","key","url","subject","weekStartDate","createdAt","statusAtCutoff","reason"]}}},"required":["runId","engineVersion","dataAsOf","timezone","weekStartDay","fromWeekStartDate","toWeekStartDate","latestCompletedWeekStartDate","configurationKey","configurationName","clockDescription","unresolvedAtCutoff","headline","weeks","agents","agentWeeks","tickets","excluded"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}/runs":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"fromWeekStartDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"toWeekStartDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"responses":{"201":{"description":"Recalculated from ticket timelines and stored as a new run","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string"},"dataAsOf":{"type":"string"}},"required":["runId","dataAsOf"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}/export":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"fromWeekStartDate","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"toWeekStartDate","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"query"}],"responses":{"202":{"description":"Excel workbook queued for email delivery","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"message":{"type":"string"},"jobId":{"type":"string"}},"required":["message","jobId"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Export is too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}/schedule":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The calculation's delivery schedule, if any","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"number"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"nextRunAt":{"type":"string","nullable":true}},"required":["id","enabled","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"integer","minimum":0,"maximum":6},"timeOfDay":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","minLength":1},"recipients":{"type":"array","items":{"type":"string","format":"email"},"minItems":1,"maxItems":20}},"required":["frequency","dayOfWeek","timeOfDay","timezone","recipients"]}}}},"responses":{"200":{"description":"Delivery schedule saved and turned on","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"number"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"nextRunAt":{"type":"string","nullable":true}},"required":["id","enabled","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt"]}},"required":["data"]}}}},"400":{"description":"Invalid schedule","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Delivery schedule turned off","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"enabled":{"type":"boolean"},"frequency":{"type":"string","enum":["weekly"]},"dayOfWeek":{"type":"number"},"timeOfDay":{"type":"string"},"timezone":{"type":"string"},"recipients":{"type":"array","items":{"type":"string"}},"nextRunAt":{"type":"string","nullable":true}},"required":["id","enabled","frequency","dayOfWeek","timeOfDay","timezone","recipients","nextRunAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla-calculations/{id}/deliveries":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scheduled deliveries, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scheduledFor":{"type":"string"},"weekStartDate":{"type":"string","nullable":true},"status":{"type":"string","enum":["running","waiting","sent","failed"]},"failureReason":{"type":"string","nullable":true,"enum":["data_not_synced","source_unreachable","send_failed","error"]},"recipients":{"type":"array","items":{"type":"string"}},"sentCount":{"type":"number"},"summary":{"type":"array","nullable":true,"items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"slaRate":{"type":"number","nullable":true}},"required":["key","name","slaRate"]}},"completedAt":{"type":"string","nullable":true},"runId":{"type":"string","nullable":true},"dataAsOf":{"type":"string","nullable":true},"engineVersion":{"type":"string","nullable":true}},"required":["id","scheduledFor","weekStartDate","status","failureReason","recipients","sentCount","summary","completedAt","runId","dataAsOf","engineVersion"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api_keys":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"API keys for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"active":{"type":"boolean"},"key":{"type":"string"},"last_used_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","active","key","last_used_at","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"object","properties":{"name":{"type":"string","nullable":true}}}}}}}},"responses":{"201":{"description":"API key created; `key` is the raw secret, shown once","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"active":{"type":"boolean"},"key":{"type":"string"},"last_used_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","active","key","last_used_at","created_at","updated_at"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/api_keys/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"API key deleted"},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla_policies":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"SLA policies for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"number","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"number"},"metric":{"type":"string"},"priority":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sla_policy":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"integer","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"bool_group":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"operator":{"type":"string","nullable":true},"value":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}},"targets":{"type":"array","nullable":true,"items":{"type":"object","properties":{"business_hours_only":{"type":"boolean","nullable":true},"goal":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"metric":{"type":"string","nullable":true},"priority":{"anyOf":[{"type":"integer"},{"type":"string"},{"nullable":true}]}}}}}}},"required":["sla_policy"]}}}},"responses":{"201":{"description":"The SLA policy","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"number","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"number"},"metric":{"type":"string"},"priority":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"SLA policy not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/sla_policies/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An SLA policy","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"number","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"number"},"metric":{"type":"string"},"priority":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]}},"required":["data"]}}}},"404":{"description":"SLA policy not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sla_policy":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"integer","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"bool_group":{"type":"string","nullable":true},"field":{"type":"string","nullable":true},"operator":{"type":"string","nullable":true},"value":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}}}},"targets":{"type":"array","nullable":true,"items":{"type":"object","properties":{"business_hours_only":{"type":"boolean","nullable":true},"goal":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"metric":{"type":"string","nullable":true},"priority":{"anyOf":[{"type":"integer"},{"type":"string"},{"nullable":true}]}}}}}}},"required":["sla_policy"]}}}},"responses":{"200":{"description":"The SLA policy","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true},"default":{"type":"boolean","nullable":true},"position":{"type":"number","nullable":true},"external_id":{"type":"string","nullable":true},"pause_statuses":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"bool_group":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","bool_group","field","operator","created_at","updated_at"]}},"targets":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"business_hours_only":{"type":"boolean"},"goal":{"type":"number"},"metric":{"type":"string"},"priority":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","business_hours_only","goal","metric","priority","created_at","updated_at"]}}},"required":["id","name","description","active","default","position","external_id","pause_statuses","created_at","updated_at","conditions","targets"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"SLA policy not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"SLA policy discarded"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"SLA policy not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_policies":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Compliance policies for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"partner_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"partner":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"partner_type":{"type":"string","nullable":true},"domains":{"type":"array","items":{"type":"string"}},"employees_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","partner_type","domains","employees_count","created_at","updated_at"]}},"required":["id","content","created_at","updated_at","partner_id","title","url","partner"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization/organization_risk_level_configuration":{"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"organization_risk_level_configuration":{"type":"object","properties":{"qa_high_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"qa_medium_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"complaint_risk_high_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"complaint_risk_medium_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"compliance_risk_high_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"compliance_risk_medium_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"chat_response_time_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"email_response_time_threshold":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]}}}},"required":["organization_risk_level_configuration"]}}}},"responses":{"200":{"description":"Updated risk level configuration","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"chat_response_time_threshold":{"type":"integer"},"email_response_time_threshold":{"type":"integer"},"qa_high_threshold":{"type":"number"},"qa_medium_threshold":{"type":"number"},"complaint_risk_high_threshold":{"type":"number"},"complaint_risk_medium_threshold":{"type":"number"},"compliance_risk_high_threshold":{"type":"number"},"compliance_risk_medium_threshold":{"type":"number"}},"required":["id","created_at","updated_at","chat_response_time_threshold","email_response_time_threshold","qa_high_threshold","qa_medium_threshold","complaint_risk_high_threshold","complaint_risk_medium_threshold","compliance_risk_high_threshold","compliance_risk_medium_threshold"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Risk level configuration not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"get":{"responses":{"200":{"description":"Risk level configuration for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"chat_response_time_threshold":{"type":"integer"},"email_response_time_threshold":{"type":"integer"},"qa_high_threshold":{"type":"number"},"qa_medium_threshold":{"type":"number"},"complaint_risk_high_threshold":{"type":"number"},"complaint_risk_medium_threshold":{"type":"number"},"compliance_risk_high_threshold":{"type":"number"},"compliance_risk_medium_threshold":{"type":"number"}},"required":["id","created_at","updated_at","chat_response_time_threshold","email_response_time_threshold","qa_high_threshold","qa_medium_threshold","complaint_risk_high_threshold","complaint_risk_medium_threshold","compliance_risk_high_threshold","compliance_risk_medium_threshold"]}},"required":["data"]}}}},"404":{"description":"Risk level configuration not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_schedules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Work schedules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"default":{"type":"boolean"},"conditions":{"nullable":true},"intervals":{"nullable":true},"external_id":{"type":"string","nullable":true},"synced":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","timezone","default","external_id","synced","organization_data_source","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_schedule":{"type":"object","properties":{"name":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"default":{"type":"boolean"},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true},{"nullable":true}]}}},"conditions":{"nullable":true},"organization_data_source_id":{"type":"string","nullable":true}}}},"required":["work_schedule"]}}}},"responses":{"201":{"description":"Work schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"default":{"type":"boolean"},"conditions":{"nullable":true},"intervals":{"nullable":true},"external_id":{"type":"string","nullable":true},"synced":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","timezone","default","external_id","synced","organization_data_source","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/work_schedules/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A work schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"default":{"type":"boolean"},"conditions":{"nullable":true},"intervals":{"nullable":true},"external_id":{"type":"string","nullable":true},"synced":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","timezone","default","external_id","synced","organization_data_source","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Work schedule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_schedule":{"type":"object","properties":{"name":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"default":{"type":"boolean"},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true},{"nullable":true}]}}},"conditions":{"nullable":true},"organization_data_source_id":{"type":"string","nullable":true}}}},"required":["work_schedule"]}}}},"responses":{"200":{"description":"Work schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"default":{"type":"boolean"},"conditions":{"nullable":true},"intervals":{"nullable":true},"external_id":{"type":"string","nullable":true},"synced":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","timezone","default","external_id","synced","organization_data_source","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"work_schedule":{"type":"object","properties":{"name":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"default":{"type":"boolean"},"intervals":{"type":"array","nullable":true,"items":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true},{"nullable":true}]}}},"conditions":{"nullable":true},"organization_data_source_id":{"type":"string","nullable":true}}}},"required":["work_schedule"]}}}},"responses":{"200":{"description":"Work schedule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"timezone":{"type":"string"},"default":{"type":"boolean"},"conditions":{"nullable":true},"intervals":{"nullable":true},"external_id":{"type":"string","nullable":true},"synced":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","timezone","default","external_id","synced","organization_data_source","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Work schedule discarded"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"status":{"type":"string"},"title":{"type":"string"},"code":{"type":"string"},"detail":{"type":"string"}},"required":["status","title","code","detail"]}}},"required":["errors"]}]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/data_sources":{"get":{"responses":{"200":{"description":"The data source catalogue","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]}}},"required":["data"]}}}}}}},"/organization_data_sources":{"get":{"parameters":[{"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"required":false,"name":"data_source_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"data_source_customer_interaction_type","in":"query"}],"responses":{"200":{"description":"Connections for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization_data_sources/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A connection","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["data"]}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]},"data":{"type":"object","properties":{"api_key":{"type":"string","nullable":true},"api_token":{"type":"string","nullable":true},"api_secret":{"type":"string","nullable":true},"webhook_secret":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"password":{"type":"string","nullable":true},"token":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"client_id":{"type":"string","nullable":true},"client_secret":{"type":"string","nullable":true}}},"user_data":{"type":"object","properties":{"subdomain":{"type":"string","nullable":true},"url":{"type":"string","nullable":true}}}}}},"required":["organization_data_source"]}}}},"responses":{"200":{"description":"Connection updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]},"data":{"type":"object","properties":{"api_key":{"type":"string","nullable":true},"api_token":{"type":"string","nullable":true},"api_secret":{"type":"string","nullable":true},"webhook_secret":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"password":{"type":"string","nullable":true},"token":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"client_id":{"type":"string","nullable":true},"client_secret":{"type":"string","nullable":true}}},"user_data":{"type":"object","properties":{"subdomain":{"type":"string","nullable":true},"url":{"type":"string","nullable":true}}}}}},"required":["organization_data_source"]}}}},"responses":{"200":{"description":"Connection updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Connection discarded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization_data_sources/{organization_data_source_id}/connection_logs":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"organization_data_source_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"created_before","in":"query"}],"responses":{"200":{"description":"Connection logs for a connection","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"data":{"nullable":true},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_data_source_id","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Connection not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/notion_pages":{"get":{"summary":"List Notion pages for the organization's Notion connection","tags":["Knowledge base"],"responses":{"200":{"description":"Notion pages","content":{"application/json":{"schema":{"type":"object","properties":{"notion_pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"organization_data_source_id":{"type":"string"}},"required":["id","title","organization_data_source_id"]}}},"required":["notion_pages"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer_issues/{id}/statistics":{"get":{"summary":"Get customer issue statistics","tags":["Customer issues"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Customer issue statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"conversation_count_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"conversation_count":{"type":"integer"}},"required":["date","conversation_count"]}},"fcr_by_date":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"root_conversations_count":{"type":"integer"},"fcr_conversations_count":{"type":"integer"},"fcr_rate":{"type":"number"},"adjusted_fcr_rate":{"type":"number"}},"required":["date","root_conversations_count","fcr_conversations_count","fcr_rate","adjusted_fcr_rate"]}},"conversations_count":{"type":"integer"},"average_handling_time":{"type":"number","nullable":true}},"required":["conversation_count_by_date","fcr_by_date","conversations_count","average_handling_time"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecard_criteria/{id}/statistics":{"get":{"summary":"Get scorecard criterion statistics","tags":["Scorecards"],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date"},"required":false,"name":"start_date","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"end_date","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"group_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"team_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"channel_types","in":"query"},{"schema":{"type":"string"},"required":false,"name":"client_ids","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"zendesk_brand_ids","in":"query"}],"responses":{"200":{"description":"Scorecard criterion statistics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"criteria_score_breakdown":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"max_score":{"type":"integer"},"passed_count":{"type":"integer"},"partial_count":{"type":"integer"},"failed_count":{"type":"integer"}},"required":["id","name","max_score","passed_count","partial_count","failed_count"]}},"average_score_by_date":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"}},"required":["date"],"additionalProperties":{"type":"number","nullable":true}}},"labels":{"type":"object","additionalProperties":{"type":"string"}}},"required":["data","labels"]},"fail_count_by_date":{"type":"object","additionalProperties":{"type":"object","additionalProperties":{"type":"integer"}}},"justification_options_breakdown":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"content":{"type":"string"},"reason":{"type":"string","nullable":true},"score_option_label":{"type":"string","nullable":true},"count":{"type":"integer"}},"required":["id","content","reason","score_option_label","count"]}}},"required":["criteria_score_breakdown","average_score_by_date","fail_count_by_date","justification_options_breakdown"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/check_results":{"get":{"summary":"List scorecard criterion check results","tags":["QA agent evaluations"],"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string","description":"JSON object of Rails `filter[...]` keys (result, scorecard_criterion_check_id, justification_option_id, created_before, created_after, conversation_qa_evaluated_after, conversation_qa_evaluated_before, score_option_types, agent_ids, team_ids, manager_ids, group_ids, organization_data_source_id, channel_types, partner_ids, zendesk_brand_ids, task_type, work_item_type, source)."},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Paginated check results","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"result":{"type":"string"},"summary":{"type":"string","nullable":true},"knowledge_base_answer":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"scorecard_criterion_check_id":{"type":"string","nullable":true},"check_description":{"type":"string","nullable":true},"criterion_name":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"conversation_external_id":{"type":"string","nullable":true},"work_item_id":{"type":"string","nullable":true,"format":"uuid"},"work_item_external_id":{"type":"string","nullable":true},"agent_name":{"type":"string","nullable":true},"selected_justification_option":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","type","content"]},"knowledge_base_citations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"citation_index":{"type":"integer"},"citation_type":{"type":"string"},"knowledge_base_document_id":{"type":"string","nullable":true},"human_feedback_type":{"type":"string","nullable":true},"human_feedback_conversation_id":{"type":"string","nullable":true},"human_feedback_agent_evaluation_scorecard_criterion_result_id":{"type":"string","nullable":true},"status_incident_id":{"type":"string","nullable":true},"status_incident_title":{"type":"string","nullable":true},"status_incident_url":{"type":"string","nullable":true},"heading_path":{"type":"string","nullable":true},"quote_exact":{"type":"string","nullable":true}},"required":["id","citation_index","citation_type","knowledge_base_document_id","human_feedback_type","human_feedback_conversation_id","human_feedback_agent_evaluation_scorecard_criterion_result_id","status_incident_id","status_incident_title","status_incident_url","heading_path","quote_exact"]}},"files":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"filename":{"type":"string"},"content_type":{"type":"string","nullable":true}},"required":["url","filename","content_type"]}}},"required":["id","result","summary","knowledge_base_answer","created_at","updated_at","scorecard_criterion_check_id","check_description","criterion_name","conversation_id","conversation_external_id","work_item_id","work_item_external_id","agent_name","selected_justification_option","knowledge_base_citations","files"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/legacy_search":{"get":{"summary":"Rails-compatible general search","description":"Compatibility port of the Rails `GET /search` pg_search endpoint (same payload, ranking and policy scope). Distinct from `/search`, the workspace command-menu search.","tags":["Search"],"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"string","description":"Comma-separated Rails searchable types (e.g. `conversation,employee`)."},"required":false,"name":"type","in":"query"}],"responses":{"200":{"description":"Search results","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string"},"caption":{"type":"string","nullable":true}},"required":["id","name","type","caption"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/check_result_failure_reasons":{"get":{"summary":"List distinct failure-reason labels for check-result chart filters","tags":["Dashboards"],"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":500},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Failure reason options","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"label":{"type":"string"}},"required":["value","label"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assignment_queues":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Assignment queues for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","members_count","distribution_mode","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignment_queue":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["assignment_queue"]}}}},"responses":{"201":{"description":"Assignment queue with its memberships","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"assignment_queue_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}}},"required":["id","name","members_count","distribution_mode","created_at","updated_at","assignment_queue_memberships"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assignment_queues/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"An assignment queue with its memberships","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"assignment_queue_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}}},"required":["id","name","members_count","distribution_mode","created_at","updated_at","assignment_queue_memberships"]}},"required":["data"]}}}},"404":{"description":"Assignment queue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignment_queue":{"type":"object","properties":{"name":{"type":"string"},"distribution_mode":{"type":"string","enum":["even","custom"]},"membership_weights":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"weight_percent":{"type":"number"}},"required":["id","weight_percent"]}}}}},"required":["assignment_queue"]}}}},"responses":{"200":{"description":"Assignment queue with its memberships","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"assignment_queue_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}}},"required":["id","name","members_count","distribution_mode","created_at","updated_at","assignment_queue_memberships"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignment_queue":{"type":"object","properties":{"name":{"type":"string"},"distribution_mode":{"type":"string","enum":["even","custom"]},"membership_weights":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"weight_percent":{"type":"number"}},"required":["id","weight_percent"]}}}}},"required":["assignment_queue"]}}}},"responses":{"200":{"description":"Assignment queue with its memberships","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"members_count":{"type":"number"},"distribution_mode":{"type":"string","enum":["even","custom"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"assignment_queue_memberships":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}}},"required":["id","name","members_count","distribution_mode","created_at","updated_at","assignment_queue_memberships"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Assignment queue deleted"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assignment_queues/{assignment_queue_id}/assignment_queue_memberships":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"assignment_queue_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Memberships of an assignment queue","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Assignment queue not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"assignment_queue_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"assignment_queue_membership":{"type":"object","properties":{"membership_id":{"type":"string"}},"required":["membership_id"]}},"required":["assignment_queue_membership"]}}}},"responses":{"201":{"description":"Assignment queue membership","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"membership_id":{"type":"string"},"membership_name":{"type":"string"},"weight_percent":{"type":"number","nullable":true},"assignments_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","membership_id","membership_name","weight_percent","assignments_count","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/assignment_queue_memberships/{id}":{"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Assignment queue membership deleted"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/redaction_rules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Redaction rules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"entity_type":{"type":"string"},"mode":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","entity_type","mode","patterns","enabled","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redaction_rule":{"type":"object","properties":{"entity_type":{"type":"string"},"mode":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}}}}},"required":["redaction_rule"]}}}},"responses":{"201":{"description":"The created redaction rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"entity_type":{"type":"string"},"mode":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","entity_type","mode","patterns","enabled","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/notification_alert_rules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Notification alert rules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"target_type":{"type":"string","nullable":true},"slack_channel_id":{"type":"number","nullable":true},"recipient_email_addresses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"slack_channel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","organization_data_source_id","created_at","updated_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","target_type","slack_channel_id","recipient_email_addresses","scorecard_id","scorecard_criterion_id","organization_data_source","slack_channel","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notification_alert_rule":{"type":"object","properties":{"target_type":{"type":"string"},"organization_data_source_id":{"type":"string","nullable":true},"slack_channel_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]}}}},"recipient_email_addresses":{"type":"array","items":{"type":"string"}}}},"scorecard_id":{"type":"string"}},"required":["notification_alert_rule"]}}}},"responses":{"201":{"description":"The created notification alert rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"target_type":{"type":"string","nullable":true},"slack_channel_id":{"type":"number","nullable":true},"recipient_email_addresses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"slack_channel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","organization_data_source_id","created_at","updated_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","target_type","slack_channel_id","recipient_email_addresses","scorecard_id","scorecard_criterion_id","organization_data_source","slack_channel","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scorecards/{scorecard_id}/notification_alert_rules":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"scorecard_id","in":"path"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Notification alert rules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"target_type":{"type":"string","nullable":true},"slack_channel_id":{"type":"number","nullable":true},"recipient_email_addresses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"slack_channel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","organization_data_source_id","created_at","updated_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","target_type","slack_channel_id","recipient_email_addresses","scorecard_id","scorecard_criterion_id","organization_data_source","slack_channel","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/notification_alert_rules/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"notification_alert_rule":{"type":"object","properties":{"target_type":{"type":"string"},"organization_data_source_id":{"type":"string","nullable":true},"slack_channel_id":{"type":"string","nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"string"}]}}}},"recipient_email_addresses":{"type":"array","items":{"type":"string"}}}},"scorecard_id":{"type":"string"}},"required":["notification_alert_rule"]}}}},"responses":{"200":{"description":"The updated notification alert rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"target_type":{"type":"string","nullable":true},"slack_channel_id":{"type":"number","nullable":true},"recipient_email_addresses":{"type":"array","nullable":true,"items":{"type":"string"}},"conditions":{"nullable":true},"scorecard_id":{"type":"string","nullable":true},"scorecard_criterion_id":{"type":"string","nullable":true},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"slack_channel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","organization_data_source_id","created_at","updated_at"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","target_type","slack_channel_id","recipient_email_addresses","scorecard_id","scorecard_criterion_id","organization_data_source","slack_channel","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Notification alert rule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Notification alert rule deleted"},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Notification alert rule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/redaction_rules/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"redaction_rule":{"type":"object","properties":{"entity_type":{"type":"string"},"mode":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"}}}},"required":["redaction_rule"]}}}},"responses":{"200":{"description":"The updated redaction rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"entity_type":{"type":"string"},"mode":{"type":"string"},"patterns":{"type":"array","items":{"type":"string"}},"enabled":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","entity_type","mode","patterns","enabled","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Redaction rule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Redaction rule deleted"},"400":{"description":"Invalid parameters or validation failure","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Redaction rule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/macros":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Macros for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"actions":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/macros/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A macro","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string","nullable":true},"actions":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","description","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Macro not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scoring_guides":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Scoring guides for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["scoring_guide"]},"attributes":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"},"enabled":{"type":"boolean"},"description":{"type":"string"},"high_description":{"type":"string"},"medium_description":{"type":"string"},"low_description":{"type":"string"},"rating_scale_description":{"type":"string"},"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"number","nullable":true}},"required":["name","content","enabled","description","high_description","medium_description","low_description","rating_scale_description","notion_page_id","organization_data_source_id"]},"relationships":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"required":["data"]}},"required":["organization_data_source"]}},"required":["id","type","attributes","relationships"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/scoring_guides/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A scoring guide","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["scoring_guide"]},"attributes":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"},"enabled":{"type":"boolean"},"description":{"type":"string"},"high_description":{"type":"string"},"medium_description":{"type":"string"},"low_description":{"type":"string"},"rating_scale_description":{"type":"string"},"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"number","nullable":true}},"required":["name","content","enabled","description","high_description","medium_description","low_description","rating_scale_description","notion_page_id","organization_data_source_id"]},"relationships":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"required":["data"]}},"required":["organization_data_source"]}},"required":["id","type","attributes","relationships"]}},"required":["data"]}}}},"404":{"description":"Scoring guide not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"scoring_guide":{"type":"object","properties":{"enabled":{"type":"boolean","nullable":true},"content":{"type":"string","nullable":true},"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"string","nullable":true}}}},"required":["scoring_guide"]}}}},"responses":{"200":{"description":"Updated scoring guide","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["scoring_guide"]},"attributes":{"type":"object","properties":{"name":{"type":"string"},"content":{"type":"string"},"enabled":{"type":"boolean"},"description":{"type":"string"},"high_description":{"type":"string"},"medium_description":{"type":"string"},"low_description":{"type":"string"},"rating_scale_description":{"type":"string"},"notion_page_id":{"type":"string","nullable":true},"organization_data_source_id":{"type":"number","nullable":true}},"required":["name","content","enabled","description","high_description","medium_description","low_description","rating_scale_description","notion_page_id","organization_data_source_id"]},"relationships":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"required":["data"]}},"required":["organization_data_source"]}},"required":["id","type","attributes","relationships"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Scoring guide or data source not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversations/check_qa_eligibility":{"post":{"operationId":"checkConversationQAEligibility","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"check_qa_eligibility":{"type":"object","properties":{"conversation_id":{"type":"string"},"custom_eligibility_instructions":{"type":"string","nullable":true},"qa_eligibility_rules":{"type":"array","nullable":true,"items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["ticket_tags","customers"]},"operator":{"type":"string","enum":["none_of"]},"values":{"type":"array","items":{"type":"string"}}},"required":["id","type","operator","values"]},{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["prompt"]},"instructions":{"type":"string"}},"required":["id","type","instructions"]}]}}},"required":["conversation_id"]}},"required":["check_qa_eligibility"]}}}},"responses":{"200":{"description":"Eligibility checked","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"eligible":{"type":"boolean"},"eligible_for_manual_evaluation":{"type":"boolean"},"eligible_for_auto_queue":{"type":"boolean"},"reason":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"passed":{"type":"boolean","nullable":true},"reason":{"type":"string"},"applies_to":{"type":"string","enum":["shared","auto_queue"]},"eligible_agent_ids":{"type":"array","nullable":true,"items":{"type":"string"}}},"required":["id","label","reason","applies_to"]}},"conversation":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","external_id","subject"]},"agents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"outcome":{"type":"string","enum":["evaluated","would_evaluate_auto","not_evaluated_auto","not_eligible"]},"reason":{"type":"string"}},"required":["id","name","outcome","reason"]}}},"required":["eligible","eligible_for_manual_evaluation","eligible_for_auto_queue","reason","checks","conversation","agents"]}},"required":["data"]}}}},"400":{"description":"Malformed request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden origin","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"conversation_id is required","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Eligibility service error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/call_script_guidelines":{"get":{"responses":{"200":{"description":"Call script guidelines for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["call_script_guideline"]},"attributes":{"type":"object","properties":{"title":{"type":"string"},"description":{"type":"string","nullable":true},"violation_alert_enabled":{"type":"boolean"},"violation_alert_risk_level":{"type":"string","nullable":true},"after_conversation_position":{"type":"number","nullable":true}},"required":["title","description","violation_alert_enabled","violation_alert_risk_level","after_conversation_position"]},"relationships":{"type":"object","properties":{"customer_account":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"required":["data"]},"line_of_business":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}},"required":["data"]},"call_script_guideline_steps":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"}},"required":["id","type"]}}},"required":["data"]}},"required":["customer_account","line_of_business","call_script_guideline_steps"]}},"required":["id","type","attributes","relationships"]}},"included":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"attributes":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","type","attributes"]}}},"required":["data","included"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/digest_emails":{"get":{"responses":{"200":{"description":"Sent digest emails for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sent_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","type","status","start_date","end_date","sent_at","created_at","updated_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/digest_emails/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A sent digest email","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sent_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"content":{"type":"string","nullable":true}},"required":["id","title","type","status","start_date","end_date","sent_at","created_at","updated_at","content"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Digest email not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Digest email deleted"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Digest email not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/digest_emails/{id}/send_email":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":255},"required":false,"name":"idempotency-key","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"digest_email":{"type":"object","properties":{"recipients":{"type":"array","items":{"type":"string"}}},"required":["recipients"]}},"required":["digest_email"]}}}},"responses":{"200":{"description":"The digest email that was resent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sent_at":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","type","status","start_date","end_date","sent_at","content","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Digest email not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Invalid recipients","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"detail":{"type":"string"},"code":{"type":"string"}},"required":["title","detail","code"]}}},"required":["errors"]}}}},"502":{"description":"Delivery to one or more recipients failed","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"object","properties":{"title":{"type":"string"},"detail":{"type":"string"},"code":{"type":"string"}},"required":["title","detail","code"]}}},"required":["errors"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_sampling_rules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string","enum":["ticket","work_item"]},"required":false,"name":"subject_type","in":"query"}],"responses":{"200":{"description":"Evaluation sampling rules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"strategy":{"type":"string"},"subject_type":{"type":"string","enum":["ticket","work_item"]},"percentage":{"type":"number","nullable":true},"count":{"type":"number","nullable":true},"period":{"type":"string","nullable":true},"filter_by":{"type":"string","nullable":true},"partition_by":{"type":"string","nullable":true},"condition_logic":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string"},"value":{"nullable":true}},"required":["field","operator"]}},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"targets":{"type":"array","items":{"type":"object","properties":{"target":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["target"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","strategy","subject_type","percentage","count","period","filter_by","partition_by","condition_logic","conditions","created_by","targets","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_sampling_rule":{"type":"object","properties":{"strategy":{"type":"string","enum":["percentage","fixed_per_period"]},"subject_type":{"type":"string","enum":["ticket","work_item"]},"percentage":{"type":"number","nullable":true},"count":{"type":"integer","nullable":true},"period":{"type":"string","nullable":true,"enum":["day","week","month"]},"filter_by":{"type":"string","nullable":true,"enum":["brand","group","team"]},"partition_by":{"type":"string","nullable":true,"enum":["brand","group","team","agent","scorecard"]},"condition_logic":{"type":"string","nullable":true,"enum":["and"]},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string","enum":["brand","group","team","source_channel"]},"operator":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string"}}},"required":["field","value"]}},"targets":{"type":"array","nullable":true,"items":{"type":"object","properties":{"target_id":{"type":"string"}},"required":["target_id"]}}}}},"required":["evaluation_sampling_rule"]}}}},"responses":{"201":{"description":"Created evaluation sampling rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"strategy":{"type":"string"},"subject_type":{"type":"string","enum":["ticket","work_item"]},"percentage":{"type":"number","nullable":true},"count":{"type":"number","nullable":true},"period":{"type":"string","nullable":true},"filter_by":{"type":"string","nullable":true},"partition_by":{"type":"string","nullable":true},"condition_logic":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string"},"value":{"nullable":true}},"required":["field","operator"]}},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"targets":{"type":"array","items":{"type":"object","properties":{"target":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["target"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","strategy","subject_type","percentage","count","period","filter_by","partition_by","condition_logic","conditions","created_by","targets","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_sampling_rules/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_sampling_rule":{"type":"object","properties":{"strategy":{"type":"string","enum":["percentage","fixed_per_period"]},"subject_type":{"type":"string","enum":["ticket","work_item"]},"percentage":{"type":"number","nullable":true},"count":{"type":"integer","nullable":true},"period":{"type":"string","nullable":true,"enum":["day","week","month"]},"filter_by":{"type":"string","nullable":true,"enum":["brand","group","team"]},"partition_by":{"type":"string","nullable":true,"enum":["brand","group","team","agent","scorecard"]},"condition_logic":{"type":"string","nullable":true,"enum":["and"]},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string","enum":["brand","group","team","source_channel"]},"operator":{"type":"string","enum":["in"]},"value":{"type":"array","items":{"type":"string"}}},"required":["field","value"]}},"targets":{"type":"array","nullable":true,"items":{"type":"object","properties":{"target_id":{"type":"string"}},"required":["target_id"]}}}}},"required":["evaluation_sampling_rule"]}}}},"responses":{"200":{"description":"Updated evaluation sampling rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"strategy":{"type":"string"},"subject_type":{"type":"string","enum":["ticket","work_item"]},"percentage":{"type":"number","nullable":true},"count":{"type":"number","nullable":true},"period":{"type":"string","nullable":true},"filter_by":{"type":"string","nullable":true},"partition_by":{"type":"string","nullable":true},"condition_logic":{"type":"string"},"conditions":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","nullable":true},"operator":{"type":"string"},"value":{"nullable":true}},"required":["field","operator"]}},"created_by":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]},"targets":{"type":"array","items":{"type":"object","properties":{"target":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["target"]}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","strategy","subject_type","percentage","count","period","filter_by","partition_by","condition_logic","conditions","created_by","targets","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Evaluation sampling rule deleted"},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/evaluation_sampling_rules/preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"evaluation_sampling_rule":{"type":"object","properties":{"filter_by":{"type":"string","nullable":true},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"array","items":{"type":"string"}}},"required":["field"]}},"targets":{"type":"array","nullable":true,"items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}}}}}},"responses":{"200":{"description":"Estimated conversations sampled per month","content":{"application/json":{"schema":{"type":"object","properties":{"estimated_count_per_month":{"type":"number"}},"required":["estimated_count_per_month"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_resolution_assignment_rules":{"get":{"responses":{"200":{"description":"Routing rules for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","nullable":true},"assignment_strategy":{"type":"string"},"event_type":{"type":"string","nullable":true},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"actions":{"type":"array","items":{"nullable":true}},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","field","operator","created_at","updated_at"]}},"assignee_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","created_at","updated_at","account"]}},"assignee_roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["id","created_at","updated_at","role"]}}},"required":["id","reference","assignment_strategy","event_type","position","created_at","updated_at","actions","conditions","assignee_accounts","assignee_roles"]}}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_resolution_assignment_rule":{"type":"object","properties":{"event_type":{"type":"string","nullable":true},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["field","operator","value"]}},"actions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"queue_id":{"type":"string"},"comment":{"type":"string"},"role_id":{"type":"string"},"notification_type":{"type":"string"},"channel_id":{"type":"string"},"api2_slack_channel_id":{"type":"string"},"addresses":{"type":"array","items":{"type":"string"}},"membership_ids":{"type":"array","items":{"type":"string"}}}}}}}},"required":["conversation_resolution_assignment_rule"]}}}},"responses":{"201":{"description":"Created routing rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","nullable":true},"assignment_strategy":{"type":"string"},"event_type":{"type":"string","nullable":true},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"actions":{"type":"array","items":{"nullable":true}},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","field","operator","created_at","updated_at"]}},"assignee_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","created_at","updated_at","account"]}},"assignee_roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["id","created_at","updated_at","role"]}}},"required":["id","reference","assignment_strategy","event_type","position","created_at","updated_at","actions","conditions","assignee_accounts","assignee_roles"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_resolution_assignment_rules/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"conversation_resolution_assignment_rule":{"type":"object","properties":{"event_type":{"type":"string","nullable":true},"conditions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"field":{"type":"string"},"operator":{"type":"string"},"value":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"required":["field","operator","value"]}},"actions":{"type":"array","nullable":true,"items":{"type":"object","properties":{"type":{"type":"string"},"queue_id":{"type":"string"},"comment":{"type":"string"},"role_id":{"type":"string"},"notification_type":{"type":"string"},"channel_id":{"type":"string"},"api2_slack_channel_id":{"type":"string"},"addresses":{"type":"array","items":{"type":"string"}},"membership_ids":{"type":"array","items":{"type":"string"}}}}}}}},"required":["conversation_resolution_assignment_rule"]}}}},"responses":{"200":{"description":"Updated routing rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"reference":{"type":"string","nullable":true},"assignment_strategy":{"type":"string"},"event_type":{"type":"string","nullable":true},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"actions":{"type":"array","items":{"nullable":true}},"conditions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"field":{"type":"string"},"operator":{"type":"string"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","field","operator","created_at","updated_at"]}},"assignee_accounts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"account":{"type":"object","properties":{"id":{"type":"string"},"full_name":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","full_name","email","created_at","updated_at"]}},"required":["id","created_at","updated_at","account"]}},"assignee_roles":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"role":{"type":"object","properties":{"id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"memberships_count":{"type":"number"},"global":{"type":"boolean"},"permissions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["id","description"]}}},"required":["id","name","description","created_at","updated_at","memberships_count","global","permissions"]}},"required":["id","created_at","updated_at","role"]}}},"required":["id","reference","assignment_strategy","event_type","position","created_at","updated_at","actions","conditions","assignee_accounts","assignee_roles"]}},"required":["data"]}}}},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Routing rule deleted"},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/conversation_resolution_assignment_rules/reorder":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"moved_rule_id":{"type":"string"},"position":{"anyOf":[{"type":"integer"},{"type":"string"}]}},"required":["moved_rule_id","position"]}}}},"responses":{"204":{"description":"Routing rules reordered"},"400":{"description":"Invalid parameters or Rails validation errors","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]},{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}]}}}},"401":{"description":"Unauthenticated","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Reorder argument error","content":{"application/json":{"schema":{"type":"object","properties":{"errors":{"type":"array","items":{"type":"string"}}},"required":["errors"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization-feature-settings":{"get":{"responses":{"200":{"description":"Feature settings for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"qaEnabled":{"type":"boolean"},"workItemQaEnabled":{"type":"boolean"},"complaintsEnabled":{"type":"boolean"},"onboardingEnabled":{"type":"boolean"},"agentMonitoringEnabled":{"type":"boolean"},"agentMonitoringDailyCap":{"type":"integer","nullable":true,"minimum":0},"agentMonitoringSetupStatus":{"type":"string","nullable":true}},"required":["qaEnabled","workItemQaEnabled","complaintsEnabled","onboardingEnabled","agentMonitoringEnabled","agentMonitoringDailyCap","agentMonitoringSetupStatus"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"qaEnabled":{"type":"boolean"},"workItemQaEnabled":{"type":"boolean"},"complaintsEnabled":{"type":"boolean"},"onboardingEnabled":{"type":"boolean"},"agentMonitoringEnabled":{"type":"boolean"},"agentMonitoringDailyCap":{"type":"integer","nullable":true,"minimum":0}},"additionalProperties":false}}}},"responses":{"200":{"description":"Updated feature settings for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"qaEnabled":{"type":"boolean"},"workItemQaEnabled":{"type":"boolean"},"complaintsEnabled":{"type":"boolean"},"onboardingEnabled":{"type":"boolean"},"agentMonitoringEnabled":{"type":"boolean"},"agentMonitoringDailyCap":{"type":"integer","nullable":true,"minimum":0},"agentMonitoringSetupStatus":{"type":"string","nullable":true}},"required":["qaEnabled","workItemQaEnabled","complaintsEnabled","onboardingEnabled","agentMonitoringEnabled","agentMonitoringDailyCap","agentMonitoringSetupStatus"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization":{"get":{"responses":{"200":{"description":"The current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization/statistics":{"get":{"responses":{"200":{"description":"Credit usage statistics for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"billing":{"type":"object","properties":{"usages":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"available":{"type":"integer"},"used":{"type":"integer"}},"required":["type","available","used"]}}},"required":["usages"]}},"required":["billing"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization/radar-chart-visibility":{"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"radar_chart_visibility":{"type":"object","additionalProperties":{"type":"boolean"},"description":"Partial map of Radar chart id → visible. Unknown chart ids are ignored; an empty object resets every chart to its default."},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2,"description":"Fraction digits (0–2) for percentage and score displays on Radar."}},"required":["radar_chart_visibility"]}}}},"responses":{"200":{"description":"Effective Radar chart visibility and decimal places for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2,"description":"Fraction digits (0–2) for percentage and score displays on Radar."},"updated_at":{"type":"string"}},"required":["radar_chart_visibility","radar_decimal_places","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organizations/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"organization":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"timezone":{"type":"string","nullable":true},"current_onboarding_step":{"type":"string","nullable":true},"partner_source_field_id":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]},"evaluation_delay_minutes":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"evaluation_contest_window_days":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"evaluation_max_contests_per_ticket":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"evaluation_ticket_started_window_days":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"attachment_retention_days":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"agent_tenure_threshold_days":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"sla_reporting_week_start_day":{"type":"string"},"default_new_member_scope":{"type":"string"},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"languages":{"type":"array","items":{"type":"string"}},"customer_issue_field_ids":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}},"radar_chart_visibility":{"type":"object","additionalProperties":{"nullable":true}},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"has_confirmed_integrations":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"has_connected_or_skipped_email_data_source":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"has_connected_or_skipped_call_data_source":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"has_connected_or_skipped_customer_support_data_source":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"social_media_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"flagged_calls_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"unauthorized_data_access_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"anomaly_detection_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"customer_authentication_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"deepfake_detection_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"pci_compliance_monitoring_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"sales_call_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"workload_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"insights_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"multilingual_support_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"experience_summary_visible":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"evaluation_delay_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"evaluate_linked_tickets_only_when_closed":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"evaluation_approvals_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"auto_resolve_on_manual_evaluation":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"coaching_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"agent_performance_reports_email_notification_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"}]}}}},"required":["organization"]}},"multipart/form-data":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Updated current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"413":{"description":"Logo too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/organizations":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter[query]","in":"query"},{"schema":{"type":"integer","minimum":1},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"All organizations, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"slug":{"type":"string"},"timezone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"current_setup_integrations_wizard_step_index":{"type":"integer"},"has_connected_or_skipped_email_data_source":{"type":"boolean"},"has_connected_or_skipped_call_data_source":{"type":"boolean"},"has_connected_or_skipped_customer_support_data_source":{"type":"boolean"},"has_confirmed_integrations":{"type":"boolean"},"social_media_monitoring_enabled":{"type":"boolean"},"flagged_calls_monitoring_enabled":{"type":"boolean"},"unauthorized_data_access_monitoring_enabled":{"type":"boolean"},"anomaly_detection_monitoring_enabled":{"type":"boolean"},"customer_authentication_monitoring_enabled":{"type":"boolean"},"deepfake_detection_enabled":{"type":"boolean"},"pci_compliance_monitoring_enabled":{"type":"boolean"},"current_onboarding_step":{"type":"string","nullable":true},"manual_qa_enabled":{"type":"boolean"},"multilingual_support_enabled":{"type":"boolean"},"languages":{"type":"array","items":{"type":"string"}},"sales_call_enabled":{"type":"boolean"},"workload_enabled":{"type":"boolean"},"insights_enabled":{"type":"boolean"},"coaching_enabled":{"type":"boolean"},"new_customer":{"type":"boolean"},"experience_summary_visible":{"type":"boolean"},"evaluation_throttle_per_hour":{"type":"integer","nullable":true},"evaluation_delay_enabled":{"type":"boolean"},"evaluation_delay_minutes":{"type":"integer"},"ingestion_mode":{"type":"string"},"evaluation_model":{"type":"string","nullable":true},"evaluation_complexity":{"type":"string","nullable":true},"evaluation_response_length":{"type":"string","nullable":true},"evaluation_reasoning_effort":{"type":"string","nullable":true},"custom_evaluation_instructions":{"type":"string","nullable":true},"custom_eligibility_instructions":{"type":"string","nullable":true},"evaluate_linked_tickets_only_when_closed":{"type":"boolean"},"evaluation_approvals_enabled":{"type":"boolean"},"auto_resolve_on_manual_evaluation":{"type":"boolean"},"evaluation_contest_window_days":{"type":"integer","nullable":true},"evaluation_max_contests_per_ticket":{"type":"integer"},"evaluation_ticket_started_window_days":{"type":"integer","nullable":true},"sla_reporting_week_start_day":{"type":"string","enum":["sunday","monday","tuesday","wednesday","thursday","friday","saturday"]},"agent_performance_reports_email_notification_enabled":{"type":"boolean"},"agent_tenure_threshold_days":{"type":"integer","nullable":true},"default_new_member_scope":{"type":"string","enum":["none","organization"]},"inbox_email_address":{"type":"string","nullable":true},"digest_banner_image_url":{"type":"string","nullable":true},"digest_window_start_date":{"type":"string"},"digest_window_end_date":{"type":"string"},"logo_url":{"type":"string","nullable":true},"has_sla_policies":{"type":"boolean"},"has_compliance_configuration":{"type":"boolean"},"qa_export_default_fields":{"type":"array","items":{"type":"string"}},"qa_export_available_fields":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"}},"required":["key","label"]}},"radar_chart_visibility":{"type":"object","properties":{"average_qa_score_overview":{"type":"boolean"},"scorecard_adherence_ratings":{"type":"boolean"},"ai_vs_manual_evaluations_trend":{"type":"boolean"},"sentiment_overview_trends":{"type":"boolean"},"service_issues_aht":{"type":"boolean"},"complaints_by_volume":{"type":"boolean"},"service_issues_bar":{"type":"boolean"}},"required":["average_qa_score_overview","scorecard_adherence_ratings","ai_vs_manual_evaluations_trend","sentiment_overview_trends","service_issues_aht","complaints_by_volume","service_issues_bar"]},"radar_decimal_places":{"type":"integer","minimum":0,"maximum":2},"customer_issue_fields":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"kind":{"type":"string","enum":["internal","customer"]},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","kind","options","organization_data_source_id","editable","created_at","updated_at"]}},"partner_source_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"label":{"type":"string"},"name":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"options":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"organization_data_source_id":{"type":"string","nullable":true},"editable":{"type":"boolean"},"organization_data_source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","label","name","value_type","options","organization_data_source_id","editable","organization_data_source","created_at","updated_at"]}},"required":["id","name","type","slug","timezone","created_at","updated_at","current_setup_integrations_wizard_step_index","has_connected_or_skipped_email_data_source","has_connected_or_skipped_call_data_source","has_connected_or_skipped_customer_support_data_source","has_confirmed_integrations","social_media_monitoring_enabled","flagged_calls_monitoring_enabled","unauthorized_data_access_monitoring_enabled","anomaly_detection_monitoring_enabled","customer_authentication_monitoring_enabled","deepfake_detection_enabled","pci_compliance_monitoring_enabled","current_onboarding_step","manual_qa_enabled","multilingual_support_enabled","languages","sales_call_enabled","workload_enabled","insights_enabled","coaching_enabled","new_customer","experience_summary_visible","evaluation_throttle_per_hour","evaluation_delay_enabled","evaluation_delay_minutes","ingestion_mode","evaluation_model","evaluation_complexity","evaluation_response_length","evaluation_reasoning_effort","custom_evaluation_instructions","custom_eligibility_instructions","evaluate_linked_tickets_only_when_closed","evaluation_approvals_enabled","auto_resolve_on_manual_evaluation","evaluation_contest_window_days","evaluation_max_contests_per_ticket","evaluation_ticket_started_window_days","sla_reporting_week_start_day","agent_performance_reports_email_notification_enabled","agent_tenure_threshold_days","default_new_member_scope","inbox_email_address","digest_banner_image_url","digest_window_start_date","digest_window_end_date","logo_url","has_sla_policies","has_compliance_configuration","qa_export_default_fields","qa_export_available_fields","radar_chart_visibility","radar_decimal_places","customer_issue_fields","partner_source_field"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/organizations/{organization_id}/digest_emails":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"organization_id","in":"path"}],"responses":{"200":{"description":"Digest emails for the organization, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sent_at":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","type","status","start_date","end_date","sent_at","content","created_at","updated_at"]}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/digest_emails/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Digest email with content","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"type":{"type":"string"},"status":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sent_at":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","title","type","status","start_date","end_date","sent_at","content","created_at","updated_at"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Digest email not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization/organization_notification_settings":{"get":{"responses":{"200":{"description":"Current organization's notification settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"number"},"agent_qa_review_frequency":{"type":"string","enum":["immediate","daily","weekly"]},"agent_qa_review_day_of_week":{"type":"number"},"agent_qa_review_time_of_day":{"type":"string"},"agent_qa_review_notification_type":{"type":"string","enum":["email","slack"]},"high_risk_incidents_urgency":{"type":"string","enum":["immediate","daily","weekly"]},"high_risk_incidents_time_of_day":{"type":"string"},"high_risk_incidents_notification_type":{"type":"string","enum":["email","slack"]},"high_risk_incidents_recipients":{"type":"array","items":{"type":"string"}},"customer_issues_digest_frequency":{"type":"string","enum":["immediate","daily","weekly"]},"customer_issues_digest_notification_type":{"type":"string","enum":["email","slack"]},"customer_issues_digest_recipients":{"type":"array","items":{"type":"string"}},"customer_issues_digest_day_of_week":{"type":"number"},"customer_issues_digest_time_of_day":{"type":"string"},"customer_issues_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_email_recipients":{"type":"array","items":{"type":"string"}},"agent_issue_alert_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_slack_connection_id":{"type":"string","nullable":true},"agent_issue_alert_new_enabled":{"type":"boolean"},"agent_issue_alert_escalating_enabled":{"type":"boolean"},"customer_issues_organization_data_source_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","agent_qa_review_frequency","agent_qa_review_day_of_week","agent_qa_review_time_of_day","agent_qa_review_notification_type","high_risk_incidents_urgency","high_risk_incidents_time_of_day","high_risk_incidents_notification_type","high_risk_incidents_recipients","customer_issues_digest_frequency","customer_issues_digest_notification_type","customer_issues_digest_recipients","customer_issues_digest_day_of_week","customer_issues_digest_time_of_day","customer_issues_slack_channel_id","agent_issue_alert_email_recipients","agent_issue_alert_slack_channel_id","agent_issue_alert_slack_connection_id","agent_issue_alert_new_enabled","agent_issue_alert_escalating_enabled","customer_issues_organization_data_source_id","created_at","updated_at"]}},"required":["data"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_notification_setting":{"type":"object","properties":{"agent_qa_review_frequency":{"type":"string","nullable":true},"agent_qa_review_day_of_week":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"agent_qa_review_time_of_day":{"type":"string","nullable":true},"agent_qa_review_notification_type":{"type":"string","nullable":true},"high_risk_incidents_urgency":{"type":"string","nullable":true},"high_risk_incidents_time_of_day":{"type":"string","nullable":true},"high_risk_incidents_notification_type":{"type":"string","nullable":true},"high_risk_incidents_recipients":{"type":"array","nullable":true,"items":{"type":"string"}},"customer_issues_digest_frequency":{"type":"string","nullable":true},"customer_issues_digest_day_of_week":{"anyOf":[{"type":"number"},{"type":"string"},{"nullable":true}]},"customer_issues_digest_time_of_day":{"type":"string","nullable":true},"customer_issues_digest_notification_type":{"type":"string","nullable":true},"customer_issues_digest_recipients":{"type":"array","nullable":true,"items":{"type":"string"}},"customer_issues_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_email_recipients":{"type":"array","nullable":true,"items":{"type":"string"}},"agent_issue_alert_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_slack_connection_id":{"type":"string","nullable":true},"agent_issue_alert_new_enabled":{"type":"boolean"},"agent_issue_alert_escalating_enabled":{"type":"boolean"},"customer_issues_organization_data_source_id":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]}}}},"required":["organization_notification_setting"]}}}},"responses":{"200":{"description":"Updated notification settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organization_id":{"type":"number"},"agent_qa_review_frequency":{"type":"string","enum":["immediate","daily","weekly"]},"agent_qa_review_day_of_week":{"type":"number"},"agent_qa_review_time_of_day":{"type":"string"},"agent_qa_review_notification_type":{"type":"string","enum":["email","slack"]},"high_risk_incidents_urgency":{"type":"string","enum":["immediate","daily","weekly"]},"high_risk_incidents_time_of_day":{"type":"string"},"high_risk_incidents_notification_type":{"type":"string","enum":["email","slack"]},"high_risk_incidents_recipients":{"type":"array","items":{"type":"string"}},"customer_issues_digest_frequency":{"type":"string","enum":["immediate","daily","weekly"]},"customer_issues_digest_notification_type":{"type":"string","enum":["email","slack"]},"customer_issues_digest_recipients":{"type":"array","items":{"type":"string"}},"customer_issues_digest_day_of_week":{"type":"number"},"customer_issues_digest_time_of_day":{"type":"string"},"customer_issues_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_email_recipients":{"type":"array","items":{"type":"string"}},"agent_issue_alert_slack_channel_id":{"type":"string","nullable":true},"agent_issue_alert_slack_connection_id":{"type":"string","nullable":true},"agent_issue_alert_new_enabled":{"type":"boolean"},"agent_issue_alert_escalating_enabled":{"type":"boolean"},"customer_issues_organization_data_source_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","organization_id","agent_qa_review_frequency","agent_qa_review_day_of_week","agent_qa_review_time_of_day","agent_qa_review_notification_type","high_risk_incidents_urgency","high_risk_incidents_time_of_day","high_risk_incidents_notification_type","high_risk_incidents_recipients","customer_issues_digest_frequency","customer_issues_digest_notification_type","customer_issues_digest_recipients","customer_issues_digest_day_of_week","customer_issues_digest_time_of_day","customer_issues_slack_channel_id","agent_issue_alert_email_recipients","agent_issue_alert_slack_channel_id","agent_issue_alert_slack_connection_id","agent_issue_alert_new_enabled","agent_issue_alert_escalating_enabled","customer_issues_organization_data_source_id","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/data_sources/{data_source_id}/organization_data_sources":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"data_source_id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_data_source":{"type":"object","properties":{"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]},"data":{"type":"object","properties":{"api_key":{"type":"string","nullable":true},"api_token":{"type":"string","nullable":true},"api_secret":{"type":"string","nullable":true},"webhook_secret":{"type":"string","nullable":true},"username":{"type":"string","nullable":true},"password":{"type":"string","nullable":true},"token":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"client_id":{"type":"string","nullable":true},"client_secret":{"type":"string","nullable":true}}},"user_data":{"type":"object","properties":{"subdomain":{"type":"string","nullable":true},"url":{"type":"string","nullable":true}}}}}},"required":["organization_data_source"]}}}},"responses":{"201":{"description":"Connection created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"An active Jira connection already exists for this site","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string","enum":["duplicate_jira_site"]},"existing_connection_id":{"type":"string"}},"required":["error","code","existing_connection_id"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization_data_sources/{id}/jira/reconnect":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","minLength":1},"email":{"type":"string","minLength":1},"api_token":{"type":"string","minLength":1}},"required":["url","email","api_token"]}}}},"responses":{"200":{"description":"Credentials replaced in place","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"revision_id":{"type":"string"}},"required":["data","revision_id"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Connection or revision not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"409":{"description":"Duplicate Jira site or the connection changed concurrently","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"422":{"description":"Jira rejected the credentials or the URL is invalid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"502":{"description":"Jira could not be reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization_data_sources/{id}/jira/credential_revisions":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Credential revision history (metadata only)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":"string","enum":["reconnect","rollback_displaced"]},"site_url":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"membership_id":{"type":"string","nullable":true},"account_id":{"type":"string","nullable":true},"restored_revision_id":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","reason","site_url","email","token_type","membership_id","account_id","restored_revision_id","created_at"]}},"connection":{"type":"object","properties":{"site_url":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"token_type":{"type":"string","nullable":true},"updated_at":{"type":"string"}},"required":["site_url","email","token_type","updated_at"]}},"required":["data","connection"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization_data_sources/{id}/jira/credential_revisions/{revision_id}/rollback":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"revision_id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"expected_updated_at":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Credentials restored from the revision","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"restored_revision_id":{"type":"string"},"displaced_revision_id":{"type":"string"}},"required":["data","restored_revision_id","displaced_revision_id"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Connection or revision not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"409":{"description":"Duplicate Jira site or the connection changed concurrently","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"code":{"type":"string"},"details":{"type":"object","additionalProperties":{"type":"string"}}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/teams/download_import_members_template":{"get":{"responses":{"200":{"description":"CSV template for importing team members","content":{"text/csv":{"schema":{"type":"string"}}}}}}},"/workspaces":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List workspaces","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/workspaces/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Workspace","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Workspace not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/features":{"get":{"responses":{"200":{"description":"Feature flags for the current account and organization","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"}]}}}}}}}},"/billing/agent-credits":{"get":{"responses":{"200":{"description":"Current Grant agent credits balance","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["agent_credits"]},"denomination":{"type":"string","enum":["credits"]},"balance":{"type":"number"},"totalBalanceGranted":{"type":"number","nullable":true}},"required":["type","denomination","balance","totalBalanceGranted"],"additionalProperties":false}},"required":["data"]}}}}}}},"/billing/credit-usage/summary":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Workspace credit usage summary for a date range","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"credits_used":{"type":"number"},"credits_remaining":{"type":"number","nullable":true},"plan_allowance":{"type":"number","nullable":true}},"required":["credits_used","credits_remaining","plan_allowance"],"additionalProperties":false}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/daily":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Daily workspace credit usage for a date range","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"credits":{"type":"number"}},"required":["date","credits"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/daily-by-type":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Daily workspace AI credit usage for a date range, split by use case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"type":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"]},"credits":{"type":"number"}},"required":["date","type","credits"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/members":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Per-member credit usage for a date range","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"credits_used":{"type":"number"}},"required":["membership_id","credits_used"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/by-member":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Per-member credit usage for a date range, split by use case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"membership_id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string","nullable":true},"credits_used":{"type":"number"},"breakdown":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"]},"credits":{"type":"number"}},"required":["type","credits"],"additionalProperties":false}}},"required":["membership_id","name","email","credits_used","breakdown"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/by-type":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Workspace-wide AI credit usage for a date range, grouped by use case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"]},"credits":{"type":"number"}},"required":["type","credits"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/by-member/{membership_id}/events":{"get":{"parameters":[{"schema":{"type":"string","description":"Rails membership prefix id (`GET /memberships` `id`)"},"required":true,"name":"membership_id","in":"path"},{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"}],"responses":{"200":{"description":"Individual AI credit usage events for a member in a date range, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"]},"credits":{"type":"number"},"charged_at":{"type":"string"},"model":{"type":"string","nullable":true,"description":"Customer-facing usage tier for this event (e.g. \"Normal\", \"Lite\"), not the underlying provider/model id."}},"required":["id","type","credits","charged_at","model"],"additionalProperties":false}}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/events":{"get":{"parameters":[{"schema":{"type":"string","description":"Inclusive range start as YYYY-MM-DD in the organization timezone"},"required":true,"name":"start_date","in":"query"},{"schema":{"type":"string","description":"Inclusive range end as YYYY-MM-DD in the organization timezone"},"required":true,"name":"end_date","in":"query"},{"schema":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"],"description":"Filter to a single use case type"},"required":false,"name":"type","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"description":"Max events to return (default 50)"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"description":"Number of events to skip for pagination"},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Workspace-wide AI credit usage events for a date range, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["agent_run","page_chat","agent_chat","qa_evaluation"]},"credits":{"type":"number"},"charged_at":{"type":"string"},"model":{"type":"string","nullable":true,"description":"Customer-facing usage tier for this event (e.g. \"Normal\", \"Lite\"), not the underlying provider/model id."},"source":{"type":"object","properties":{"kind":{"type":"string","enum":["member","agent"]},"name":{"type":"string"},"email":{"type":"string","nullable":true}},"required":["kind","name","email"],"additionalProperties":false}},"required":["id","type","credits","charged_at","model","source"],"additionalProperties":false}},"has_more":{"type":"boolean"}},"required":["data","has_more"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-usage/breakdown":{"get":{"parameters":[{"schema":{"type":"string","description":"Usage date as YYYY-MM-DD in the organization timezone"},"required":true,"name":"date","in":"query"}],"responses":{"200":{"description":"AI credit usage breakdown for a single day","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"date":{"type":"string"},"total_credits":{"type":"number"},"items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["member","agent"]},"id":{"type":"string","nullable":true},"name":{"type":"string"},"email":{"type":"string","nullable":true},"source_label":{"type":"string"},"credits_used":{"type":"number"}},"required":["kind","id","name","email","source_label","credits_used"],"additionalProperties":false}}},"required":["date","total_credits","items"],"additionalProperties":false}},"required":["data"]}}}},"400":{"description":"Invalid date","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/credit-packs":{"get":{"responses":{"200":{"description":"Credit packs available for the workspace's active subscription plan","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"has_subscription":{"type":"boolean"},"currency_code":{"type":"string","nullable":true},"credit_packs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"pricing_unit_code":{"type":"string"},"pricing_unit_name":{"type":"string","nullable":true},"money_minor":{"type":"string"},"unit_amount":{"type":"string"},"expiration_interval_count":{"type":"integer","nullable":true},"expiration_interval_unit":{"type":"string","nullable":true}},"required":["id","code","pricing_unit_code","pricing_unit_name","money_minor","unit_amount","expiration_interval_count","expiration_interval_unit"],"additionalProperties":false}}},"required":["has_subscription","currency_code","credit_packs"],"additionalProperties":false}},"required":["data"]}}}}}}},"/billing/credit-packs/checkout":{"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"credit_pack_id":{"type":"string","minLength":1},"quantity":{"type":"number","nullable":true,"minimum":0,"exclusiveMinimum":true,"description":"Fixed number of pricing units to buy. Omit to let the customer choose on the hosted page."}},"required":["credit_pack_id"],"additionalProperties":false}}}},"responses":{"200":{"description":"Hosted checkout link for the credit pack purchase","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}},"required":["data"]}}}},"400":{"description":"Workspace is not eligible to purchase credit packs","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Credit pack not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Grant checkout link could not be created","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/spend-caps/settings":{"get":{"responses":{"200":{"description":"Workspace default spend cap settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"default_member_monthly_cap_credits":{"type":"integer","nullable":true}},"required":["default_member_monthly_cap_credits"],"additionalProperties":false}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"spend_cap_settings":{"type":"object","properties":{"default_member_monthly_cap_credits":{"type":"integer","nullable":true,"minimum":0}},"required":["default_member_monthly_cap_credits"],"additionalProperties":false}},"required":["spend_cap_settings"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated workspace default spend cap settings","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"default_member_monthly_cap_credits":{"type":"integer","nullable":true}},"required":["default_member_monthly_cap_credits"],"additionalProperties":false}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/spend-caps":{"get":{"responses":{"200":{"description":"Workspace members eligible for chat spend caps","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"spend_cap_credits":{"type":"integer","nullable":true},"effective_spend_cap_credits":{"type":"integer","nullable":true},"spend_cap_source":{"type":"string","enum":["custom","default","none"]},"credits_used":{"type":"number"},"team_ids":{"type":"array","items":{"type":"string"}},"partner_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","email","spend_cap_credits","effective_spend_cap_credits","spend_cap_source","credits_used","team_ids","partner_ids"],"additionalProperties":false}}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/billing/spend-caps/{membership_id}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"membership_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"spend_cap":{"type":"object","properties":{"monthly_cap_credits":{"type":"integer","nullable":true,"minimum":0}},"required":["monthly_cap_credits"],"additionalProperties":false}},"required":["spend_cap"],"additionalProperties":false}}}},"responses":{"200":{"description":"Updated spend cap for a workspace member","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"spend_cap_credits":{"type":"integer","nullable":true},"effective_spend_cap_credits":{"type":"integer","nullable":true},"spend_cap_source":{"type":"string","enum":["custom","default","none"]},"credits_used":{"type":"number"},"team_ids":{"type":"array","items":{"type":"string"}},"partner_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","email","spend_cap_credits","effective_spend_cap_credits","spend_cap_source","credits_used","team_ids","partner_ids"],"additionalProperties":false}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Member not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-providers":{"get":{"operationId":"listBotProviders","responses":{"200":{"description":"Bot providers","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"},"websiteUrl":{"type":"string","format":"uri"},"logoUrl":{"type":"string","format":"uri"}},"required":["id","slug","name","websiteUrl","logoUrl"]}}},"required":["data"]}}}}}}},"/bot-signals/bots":{"get":{"operationId":"listBotSignalBots","responses":{"200":{"description":"Bots known to bot QA for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"employeeId":{"type":"string"},"botProviderId":{"type":"string","nullable":true,"format":"uuid"},"providerName":{"type":"string","nullable":true},"providerLogoUrl":{"type":"string","nullable":true},"active":{"type":"boolean"}},"required":["id","name","employeeId","botProviderId","providerName","providerLogoUrl","active"]}}},"required":["data"]}}}}}}},"/bot-signals/summary":{"get":{"operationId":"getBotSignalSummary","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Aggregated bot signal metrics for one bot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sampleCount":{"type":"number"},"signalMeans":{"type":"object","properties":{"resolution":{"type":"number","nullable":true},"compliance":{"type":"number","nullable":true},"effort":{"type":"number","nullable":true},"escalation":{"type":"number","nullable":true},"knowledge":{"type":"number","nullable":true},"hallucination":{"type":"number","nullable":true}},"required":["resolution","compliance","effort","escalation","knowledge","hallucination"]},"hallucinationFlagShare":{"type":"number","nullable":true},"complianceFlagShare":{"type":"number","nullable":true},"outcomes":{"type":"object","properties":{"held":{"type":"number"},"repeatContact":{"type":"number"},"unrelatedContact":{"type":"number"},"reopened":{"type":"number"}},"required":["held","repeatContact","unrelatedContact","reopened"]},"disagreement":{"type":"object","properties":{"trueResolution":{"type":"number"},"confidentWrongness":{"type":"number"},"silentAbandonment":{"type":"number"},"honestFailure":{"type":"number"}},"required":["trueResolution","confidentWrongness","silentAbandonment","honestFailure"]}},"required":["sampleCount","signalMeans","hallucinationFlagShare","complianceFlagShare","outcomes","disagreement"]}},"required":["data"]}}}},"404":{"description":"Unknown bot"}}}},"/bot-signals/proficiency":{"get":{"operationId":"listBotSignalProficiencies","parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Current sampled proficiency scores for the organization's active bots","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"},"botName":{"type":"string"},"sampleCount":{"type":"integer"},"scores":{"type":"object","properties":{"resolution":{"type":"number","minimum":0,"maximum":1},"compliance":{"type":"number","minimum":0,"maximum":1},"effort":{"type":"number","minimum":0,"maximum":1},"escalation":{"type":"number","minimum":0,"maximum":1},"knowledge":{"type":"number","minimum":0,"maximum":1},"hallucination":{"type":"number","minimum":0,"maximum":1}},"required":["resolution","compliance","effort","escalation","knowledge","hallucination"]}},"required":["botId","botName","sampleCount","scores"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"},"503":{"description":"Resolution-rate report query failed"}}}},"/bot-signals/resolution-rate":{"get":{"operationId":"getBotSignalResolutionRate","responses":{"200":{"description":"Strict sampled resolution rate for the organization and its active bots","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"methodologyVersion":{"type":"integer"},"settledThrough":{"type":"string"},"current":{"type":"object","properties":{"supported":{"type":"boolean"},"rate":{"type":"number","nullable":true},"sampleCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"coveredEligibleCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"confidenceLower":{"type":"number","nullable":true},"confidenceUpper":{"type":"number","nullable":true}},"required":["supported","rate","sampleCount","eligibleCount","coveredEligibleCount","coverage","confidenceLower","confidenceUpper"]},"previous":{"type":"object","properties":{"supported":{"type":"boolean"},"rate":{"type":"number","nullable":true},"sampleCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"coveredEligibleCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"confidenceLower":{"type":"number","nullable":true},"confidenceUpper":{"type":"number","nullable":true}},"required":["supported","rate","sampleCount","eligibleCount","coveredEligibleCount","coverage","confidenceLower","confidenceUpper"]},"deltaPercentagePoints":{"type":"number","nullable":true},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"previousDate":{"type":"string"},"currentRate":{"type":"number","nullable":true},"previousRate":{"type":"number","nullable":true},"currentSampleCount":{"type":"integer"},"previousSampleCount":{"type":"integer"}},"required":["date","previousDate","currentRate","previousRate","currentSampleCount","previousSampleCount"]}},"bots":{"type":"array","items":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"},"botName":{"type":"string"},"current":{"type":"object","properties":{"supported":{"type":"boolean"},"rate":{"type":"number","nullable":true},"sampleCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"coveredEligibleCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"confidenceLower":{"type":"number","nullable":true},"confidenceUpper":{"type":"number","nullable":true}},"required":["supported","rate","sampleCount","eligibleCount","coveredEligibleCount","coverage","confidenceLower","confidenceUpper"]},"previous":{"type":"object","properties":{"supported":{"type":"boolean"},"rate":{"type":"number","nullable":true},"sampleCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"coveredEligibleCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"confidenceLower":{"type":"number","nullable":true},"confidenceUpper":{"type":"number","nullable":true}},"required":["supported","rate","sampleCount","eligibleCount","coveredEligibleCount","coverage","confidenceLower","confidenceUpper"]},"deltaPercentagePoints":{"type":"number","nullable":true}},"required":["botId","botName","current","previous","deltaPercentagePoints"]}}},"required":["methodologyVersion","settledThrough","current","previous","deltaPercentagePoints","series","bots"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/containment":{"get":{"operationId":"getBotSignalContainment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"}],"responses":{"200":{"description":"Census containment rate for the organization and its bots","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"settledThrough":{"type":"string"},"current":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"eligibleCount":{"type":"integer"},"containedCount":{"type":"integer"}},"required":["rate","eligibleCount","containedCount"]},"previous":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"eligibleCount":{"type":"integer"},"containedCount":{"type":"integer"}},"required":["rate","eligibleCount","containedCount"]},"deltaPercentagePoints":{"type":"number","nullable":true},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"previousDate":{"type":"string"},"currentRate":{"type":"number","nullable":true},"previousRate":{"type":"number","nullable":true},"currentEligibleCount":{"type":"integer"},"previousEligibleCount":{"type":"integer"}},"required":["date","previousDate","currentRate","previousRate","currentEligibleCount","previousEligibleCount"]}},"bots":{"type":"array","items":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"},"botName":{"type":"string"},"current":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"eligibleCount":{"type":"integer"},"containedCount":{"type":"integer"}},"required":["rate","eligibleCount","containedCount"]},"previous":{"type":"object","properties":{"rate":{"type":"number","nullable":true},"eligibleCount":{"type":"integer"},"containedCount":{"type":"integer"}},"required":["rate","eligibleCount","containedCount"]},"deltaPercentagePoints":{"type":"number","nullable":true}},"required":["botId","botName","current","previous","deltaPercentagePoints"]}}},"required":["settledThrough","current","previous","deltaPercentagePoints","series","bots"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/accuracy-series":{"get":{"operationId":"getBotSignalAccuracySeries","parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Daily sampled accuracy buckets across the organization's bots","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sampleCount":{"type":"integer"},"passCount":{"type":"integer"}},"required":["date","sampleCount","passCount"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/hallucination-series":{"get":{"operationId":"getBotSignalHallucinationSeries","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Daily hallucination buckets for one bot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"sampleCount":{"type":"number"},"flaggedCount":{"type":"number"}},"required":["date","sampleCount","flaggedCount"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/hallucinations":{"get":{"operationId":"listBotSignalHallucinations","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"day","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Rated conversations flagged for hallucination in the window","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"number"},"conversations":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"score":{"type":"number"},"ratedAt":{"type":"string"},"quote":{"type":"string","nullable":true},"rationale":{"type":"string","nullable":true}},"required":["conversationId","score","ratedAt","quote","rationale"]}}},"required":["total","conversations"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/compliance-misses":{"get":{"operationId":"getBotSignalComplianceMisses","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Compliance misses and miss-type topics over the rated sample","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sampleCount":{"type":"number"},"missCount":{"type":"number"},"missRate":{"type":"number","nullable":true},"byTopic":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"description":{"type":"string"},"count":{"type":"number"}},"required":["topic","description","count"]}}},"required":["sampleCount","missCount","missRate","byTopic"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/escalation-demand":{"get":{"operationId":"getBotSignalEscalationDemand","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Escalation demand over the window, measured on the rated sample","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"sampleCount":{"type":"number"},"demandCount":{"type":"number"},"demandRate":{"type":"number","nullable":true},"byTopic":{"type":"array","items":{"type":"object","properties":{"topic":{"type":"string"},"description":{"type":"string"},"count":{"type":"number"}},"required":["topic","description","count"]}}},"required":["sampleCount","demandCount","demandRate","byTopic"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/rcsat":{"get":{"operationId":"getBotSignalRcsat","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Daily rCSAT buckets for one bot (settled days only)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"index":{"type":"number","nullable":true},"conversationCount":{"type":"number"},"reopenedCount":{"type":"number"},"relatedRepeatCount":{"type":"number"}},"required":["day","index","conversationCount","reopenedCount","relatedRepeatCount"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/conversation-rcsat":{"get":{"operationId":"listBotSignalConversationRcsat","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","minLength":1,"description":"Comma-separated conversation prefix ids"},"required":true,"description":"Comma-separated conversation prefix ids","name":"conversationIds","in":"query"}],"responses":{"200":{"description":"Per-conversation rCSAT index (0-100) from stored bot-signal outcomes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"rcsat":{"type":"number","nullable":true}},"required":["conversationId","rcsat"]}}},"required":["data"]}}}},"400":{"description":"Too many conversation ids"},"404":{"description":"Unknown organization"}}}},"/bot-signals/topics":{"get":{"operationId":"listBotFailureTopics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","enum":["resolution","compliance","effort","escalation","knowledge","hallucination"]},"required":false,"name":"signalArea","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Failure topics for one bot, ranked by impact","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"signalArea":{"type":"string","enum":["resolution","compliance","effort","escalation","knowledge","hallucination"]},"count":{"type":"number"},"previousCount":{"type":"number"},"impact":{"type":"number"},"interactionCount":{"type":"number"},"rcsat":{"type":"number","nullable":true},"examples":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"quote":{"type":"string"}},"required":["conversationId","quote"]}}},"required":["id","name","description","signalArea","count","previousCount","impact","interactionCount","rcsat","examples"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/bots/{botId}/gap-topics":{"get":{"operationId":"listBotHandoffGapTopics","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Ranked capability-gap topics for one bot (What to fix next), volume ≥ 2 in window","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"gapType":{"type":"string","enum":["missing_tool","missing_data_point","tool_returns_wrong_data","knowledge_mismatch"]},"title":{"type":"string"},"description":{"type":"string"},"volume":{"type":"integer"},"examples":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"title":{"type":"string"},"why":{"type":"string"}},"required":["conversationId","title","why"]}}},"required":["id","gapType","title","description","volume","examples"]}}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/bots/{botId}/gap-topics/{topicId}/examples":{"get":{"operationId":"listBotHandoffGapTopicExamples","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"topicId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated example conversations for one gap topic (newest unique first)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"integer"},"examples":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"title":{"type":"string"},"why":{"type":"string"}},"required":["conversationId","title","why"]}}},"required":["total","examples"]}},"required":["data"]}}}},"404":{"description":"Unknown organization or topic"}}}},"/bot-signals/bots/{botId}/gap-topics/{topicId}/dismiss":{"post":{"operationId":"dismissBotHandoffGapTopic","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"topicId","in":"path"}],"responses":{"200":{"description":"Gap topic dismissed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Unknown organization or topic"},"422":{"description":"Topic is not active"}}}},"/bot-signals/manipulation":{"get":{"operationId":"getBotManipulationAttempts","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Manipulation attempts observed on all of one bot's conversations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"number"},"compliedTotal":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"number"}},"required":["date","count"]}},"byVector":{"type":"array","items":{"type":"object","properties":{"vector":{"type":"string","enum":["instruction_override","system_prompt_fishing","roleplay_jailbreak","encoding_obfuscation","social_engineering","data_exfiltration","false_premise","other"]},"total":{"type":"number"},"outcomes":{"type":"object","properties":{"resisted":{"type":"number"},"partiallyComplied":{"type":"number"},"complied":{"type":"number"}},"required":["resisted","partiallyComplied","complied"]},"techniques":{"type":"array","items":{"type":"object","properties":{"technique":{"type":"string"},"count":{"type":"number"}},"required":["technique","count"]}}},"required":["vector","total","outcomes","techniques"]}}},"required":["total","compliedTotal","daily","byVector"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/recommended-fixes":{"get":{"operationId":"listBotRecommendedFixes","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Open recommended fixes for a bot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"caption":{"type":"string"},"openCount":{"type":"integer","minimum":0},"fixes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"category":{"type":"string","enum":["Knowledge base","Tool / capability","Guardrails"]},"title":{"type":"string"},"description":{"type":"string"},"points":{"type":"string"},"criterion":{"type":"string","enum":["Draft doc","Update doc","Suggestion"]},"action":{"type":"string","enum":["Draft doc","Update doc","Suggestion"]},"evidenceCount":{"type":"number"},"status":{"type":"string","enum":["open","accepted","dismissed"]}},"required":["id","category","title","description","points","criterion","action","evidenceCount","status"]}}},"required":["caption","openCount","fixes"]}},"required":["data"]}}}},"404":{"description":"Unknown organization"}}}},"/bot-signals/recommended-fixes/{fixId}":{"get":{"operationId":"getBotRecommendedFix","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"fixId","in":"path"}],"responses":{"200":{"description":"Recommended fix detail with evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"category":{"type":"string","enum":["knowledge_base","tool_capability","guardrails"]},"action":{"type":"string","enum":["draft_doc","update_doc","suggest"]},"status":{"type":"string","enum":["open","accepted","dismissed"]},"rank":{"type":"number"},"evidenceCount":{"type":"number"},"draftTitle":{"type":"string"},"draftContent":{"type":"string"},"targetRailsDocumentId":{"type":"string","nullable":true},"targetRailsDocumentTitle":{"type":"string","nullable":true},"missRationale":{"type":"string","nullable":true},"acceptedRailsDocumentId":{"type":"string","nullable":true},"acceptedAt":{"type":"string","nullable":true},"dismissedAt":{"type":"string","nullable":true},"evidences":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversationId":{"type":"string"},"topic":{"type":"string"},"botApproach":{"type":"string"},"humanApproach":{"type":"string"},"botQuote":{"type":"string"},"humanQuote":{"type":"string"}},"required":["id","conversationId","topic","botApproach","humanApproach","botQuote","humanQuote"]}}},"required":["id","title","description","category","action","status","rank","evidenceCount","draftTitle","draftContent","targetRailsDocumentId","targetRailsDocumentTitle","missRationale","acceptedRailsDocumentId","acceptedAt","dismissedAt","evidences"]}},"required":["data"]}}}},"404":{"description":"Unknown organization or fix"}}}},"/bot-signals/recommended-fixes/{fixId}/accept":{"post":{"operationId":"acceptBotRecommendedFix","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"fixId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"draftTitle":{"type":"string","minLength":1,"maxLength":200},"draftContent":{"type":"string","minLength":1,"maxLength":50000}}}}}},"responses":{"200":{"description":"Fix accepted; Rails Library document written","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"acceptedRailsDocumentId":{"type":"string","nullable":true}},"required":["id","acceptedRailsDocumentId"]}},"required":["data"]}}}},"404":{"description":"Unknown organization or fix"},"422":{"description":"Fix is not open or Rails write failed"}}}},"/bot-signals/recommended-fixes/{fixId}/dismiss":{"post":{"operationId":"dismissBotRecommendedFix","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"fixId","in":"path"}],"responses":{"200":{"description":"Fix dismissed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Unknown organization or fix"},"422":{"description":"Fix is not open"}}}},"/bot-topic-classifier-builds":{"post":{"operationId":"startBotTopicClassifierBuild","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"parentTopicId":{"type":"string","nullable":true,"format":"uuid"},"instructions":{"type":"string","minLength":3,"maxLength":2000}},"required":["instructions"]}}}},"responses":{"202":{"description":"Topic classifier build queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Organization unavailable"}}}},"/bot-topic-classifier-builds/{runId}":{"get":{"operationId":"getBotTopicClassifierBuild","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Durable topic classifier build state","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","researching","building","reviewing","backfilling","ready","failed"]},"instructions":{"type":"string"},"topicName":{"type":"string","nullable":true},"topicDescription":{"type":"string","nullable":true},"reviewedCount":{"type":"integer"},"candidateCount":{"type":"integer"},"matchedCount":{"type":"integer"},"error":{"type":"string","nullable":true},"publishedTopicId":{"type":"string","nullable":true,"format":"uuid"},"examples":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversationId":{"type":"string"},"excerpt":{"type":"string"},"confidence":{"type":"number"},"evidence":{"type":"array","items":{"type":"string"}},"label":{"type":"boolean","nullable":true}},"required":["id","conversationId","excerpt","confidence","evidence","label"]}}},"required":["id","status","instructions","topicName","topicDescription","reviewedCount","candidateCount","matchedCount","error","publishedTopicId","examples"]}},"required":["data"]}}}},"404":{"description":"Build unavailable"}}}},"/bot-topic-classifier-builds/{runId}/examples/{exampleId}/review":{"post":{"operationId":"reviewBotTopicClassifierExample","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"exampleId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"boolean"}},"required":["label"]}}}},"responses":{"200":{"description":"Example reviewed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"reviewed":{"type":"boolean","enum":[true]}},"required":["reviewed"]}},"required":["data"]}}}},"404":{"description":"Example unavailable"}}}},"/bot-topics/proficiency-gaps/{type}":{"get":{"operationId":"getBotProficiencyGapDetail","parameters":[{"schema":{"type":"string","enum":["missing_data","knowledge","missing_tool"]},"required":true,"name":"type","in":"path"}],"responses":{"200":{"description":"Organization-wide proficiency gap trends and recommendations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"type":{"type":"string","enum":["missing_data","knowledge","missing_tool"]},"from":{"type":"string"},"to":{"type":"string"},"gapCount":{"type":"integer"},"handoffCount":{"type":"integer"},"addressableCount":{"type":"integer"},"shareOfHandoffs":{"type":"number","nullable":true},"addressableShare":{"type":"number","nullable":true},"series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"gapCount":{"type":"integer"},"handoffCount":{"type":"integer"},"share":{"type":"number","nullable":true}},"required":["day","gapCount","handoffCount","share"]}},"recommendations":{"type":"array","items":{"type":"object","properties":{"recommendationId":{"type":"string","format":"uuid"},"reasonId":{"type":"string","format":"uuid"},"topicId":{"type":"string","format":"uuid"},"topicName":{"type":"string"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"title":{"type":"string"},"description":{"type":"string"},"ticketCount":{"type":"integer"}},"required":["recommendationId","reasonId","topicId","topicName","type","title","description","ticketCount"]}}},"required":["type","from","to","gapCount","handoffCount","addressableCount","shareOfHandoffs","addressableShare","series","recommendations"]}},"required":["data"]}}}},"404":{"description":"Organization unavailable"}}}},"/bot-topics/generations/{generationId}":{"get":{"operationId":"getBotTopicGeneration","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"generationId","in":"path"}],"responses":{"200":{"description":"Tenant-scoped persisted topic generation and token usage","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"operation":{"type":"string"},"model":{"type":"string"},"status":{"type":"string"},"inputTokens":{"type":"number","nullable":true},"outputTokens":{"type":"number","nullable":true},"reservedTokens":{"type":"number"},"result":{"nullable":true}},"required":["id","operation","model","status","inputTokens","outputTokens","reservedTokens"]}},"required":["data"]}}}},"404":{"description":"Generation unavailable"}}}},"/bot-topics/{topicId}/escalations":{"get":{"operationId":"getBotTopicEscalations","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"topicId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Evidence-grounded handoff reasons and analyzed tickets for one customer topic","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"topicId":{"type":"string","format":"uuid"},"methodologyVersion":{"type":"integer"},"topicMethodologyVersion":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"escalationCount":{"type":"integer"},"analyzedCount":{"type":"integer"},"classifiedCount":{"type":"integer"},"correctToEscalateCount":{"type":"integer"},"addressableCount":{"type":"integer"},"insufficientEvidenceCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"analysis":{"type":"string","nullable":true},"dailySeries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"escalated":{"type":"integer"},"contained":{"type":"integer"}},"required":["date","escalated","contained"]}},"reasons":{"type":"array","items":{"type":"object","properties":{"reasonId":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"cause":{"type":"string","enum":["human_required","knowledge_gap","data_access_gap","action_gap","agent_failure"]},"ticketCount":{"type":"integer"},"share":{"type":"number","nullable":true}},"required":["reasonId","name","description","cause","ticketCount","share"]}},"recommendations":{"type":"array","items":{"type":"object","properties":{"recommendationId":{"type":"string","format":"uuid"},"reasonId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"title":{"type":"string"},"description":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ticketCount":{"type":"integer"},"estimatedMonthlyContainedTickets":{"type":"integer","minimum":0},"confidence":{"type":"number"}},"required":["recommendationId","reasonId","type","capabilitySubtype","title","description","artifactTitle","artifactContent","acceptanceCriteria","ticketCount","estimatedMonthlyContainedTickets","confidence"]}},"tickets":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"externalId":{"type":"string","nullable":true},"ticketSummary":{"type":"string"},"reasonId":{"type":"string","nullable":true,"format":"uuid"},"reasonName":{"type":"string","nullable":true},"cause":{"type":"string","nullable":true,"enum":["human_required","knowledge_gap","data_access_gap","action_gap","agent_failure"]},"humanOutcome":{"type":"string","enum":["answered","action_taken","specialist_handled","unresolved","no_visible_resolution","unclear"]},"status":{"type":"string","enum":["classified","insufficient_evidence"]},"confidence":{"type":"number"}},"required":["conversationId","externalId","ticketSummary","reasonId","reasonName","cause","humanOutcome","status","confidence"]}}},"required":["topicId","methodologyVersion","topicMethodologyVersion","from","to","escalationCount","analyzedCount","classifiedCount","correctToEscalateCount","addressableCount","insufficientEvidenceCount","coverage","analysis","dailySeries","reasons","recommendations","tickets"]}},"required":["data"]}}}},"404":{"description":"Topic unavailable"}}}},"/bot-topics":{"get":{"operationId":"getBotTopicReport","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Sample-based handoff rates by discovered customer intent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"enabled":{"type":"boolean"},"methodologyVersion":{"type":"integer"},"taxonomyVersion":{"type":"integer"},"stage":{"type":"string","enum":["collecting","initial","refining","established"]},"from":{"type":"string"},"to":{"type":"string"},"eligibleCount":{"type":"integer"},"selectedCount":{"type":"integer"},"requestCount":{"type":"integer"},"excludedCount":{"type":"integer"},"analyzedCount":{"type":"integer"},"notAnalyzedCount":{"type":"integer"},"coverage":{"type":"number","nullable":true},"taxonomyQuality":{"type":"object","properties":{"mappedRequestCount":{"type":"integer"},"agreementCount":{"type":"integer"},"disagreementCount":{"type":"integer"},"disagreements":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"assignedTopicId":{"type":"string","format":"uuid"},"assignedTopicName":{"type":"string"},"mappedTopicId":{"type":"string","format":"uuid"},"mappedTopicName":{"type":"string"},"conversationFieldId":{"type":"integer"},"externalFieldId":{"type":"string","nullable":true},"fieldLabel":{"type":"string"},"rawOptionValue":{"type":"string"},"optionLabel":{"type":"string"}},"required":["conversationId","assignedTopicId","assignedTopicName","mappedTopicId","mappedTopicName","conversationFieldId","externalFieldId","fieldLabel","rawOptionValue","optionLabel"]}}},"required":["mappedRequestCount","agreementCount","disagreementCount","disagreements"]},"proficiencyGaps":{"type":"object","properties":{"analyzedCount":{"type":"integer"},"rows":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["missing_data","knowledge","missing_tool"]},"count":{"type":"integer"},"share":{"type":"number"}},"required":["type","count","share"]}}},"required":["analyzedCount","rows"]},"rows":{"type":"array","items":{"type":"object","properties":{"topicId":{"type":"string","format":"uuid"},"parentTopicId":{"type":"string","nullable":true,"format":"uuid"},"depth":{"type":"integer","minimum":0},"hasChildren":{"type":"boolean"},"status":{"type":"string","enum":["active","retired"]},"name":{"type":"string"},"description":{"type":"string"},"directAnalyzedCount":{"type":"integer"},"directHandoffCount":{"type":"integer"},"directRate":{"type":"number","nullable":true},"analyzedCount":{"type":"integer"},"handoffCount":{"type":"integer"},"estimatedMonthlyVolume":{"type":"integer","minimum":0},"estimatedMonthlyAddressableCount":{"type":"integer","minimum":0},"rate":{"type":"number","nullable":true},"rcsat":{"type":"number","nullable":true},"lowVolume":{"type":"boolean"}},"required":["topicId","parentTopicId","depth","hasChildren","status","name","description","directAnalyzedCount","directHandoffCount","directRate","analyzedCount","handoffCount","estimatedMonthlyVolume","estimatedMonthlyAddressableCount","rate","rcsat","lowVolume"]}}},"required":["enabled","methodologyVersion","taxonomyVersion","stage","from","to","eligibleCount","selectedCount","requestCount","excludedCount","analyzedCount","notAnalyzedCount","coverage","taxonomyQuality","proficiencyGaps","rows"]}},"required":["data"]}}}}}}},"/bot-topics/{topicId}/examples":{"get":{"operationId":"getBotTopicExamples","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"topicId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Up to 20 analyzed conversations; same cohort as the report","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"externalId":{"type":"string","nullable":true},"intent":{"type":"string","nullable":true},"handedOff":{"type":"boolean"},"rcsat":{"type":"number","nullable":true}},"required":["conversationId","externalId","intent","handedOff","rcsat"]}}},"required":["data"]}}}}}}},"/bot-signals/issues":{"get":{"operationId":"listBotIssues","parameters":[{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Grouped bot issues and their current-window impact","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"botName":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high"]},"category":{"type":"string","enum":["tool","workflow","knowledge","instruction","guardrail","escalation","other"]},"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"source":{"type":"string","enum":["deterministic","model","manual"]},"subjectType":{"type":"string","enum":["action","workflow","intent","other"]},"subjectName":{"type":"string","nullable":true},"outcome":{"type":"string","nullable":true},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"},"instanceCount":{"type":"integer"},"affectedConversationCount":{"type":"integer"},"maturity":{"type":"string","enum":["emerging","mature"]},"foundBy":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["rulebase"]},"name":{"type":"string","enum":["Rulebase"]},"initials":{"nullable":true}},"required":["kind","name","initials"]},{"type":"object","properties":{"kind":{"type":"string","enum":["person"]},"name":{"type":"string"},"initials":{"type":"string"}},"required":["kind","name","initials"]}]},"tags":{"type":"array","items":{"type":"string"}},"verification":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"recommendation":{"type":"object","nullable":true,"properties":{"recommendationId":{"type":"string","format":"uuid"},"reasonId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"title":{"type":"string"},"description":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ticketCount":{"type":"integer"},"estimatedMonthlyContainedTickets":{"type":"integer","minimum":0},"confidence":{"type":"number"}},"required":["recommendationId","reasonId","type","capabilitySubtype","title","description","artifactTitle","artifactContent","acceptanceCriteria","ticketCount","estimatedMonthlyContainedTickets","confidence"]},"dailySeries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"integer"}},"required":["date","count"]}}},"required":["id","botId","botName","title","description","severity","category","status","source","subjectType","subjectName","outcome","firstSeenAt","lastSeenAt","instanceCount","affectedConversationCount","maturity","foundBy","tags","verification","recommendation","dailySeries"]}},"total":{"type":"integer"}},"required":["data","total"]}}}},"400":{"description":"Invalid issue window","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/adjacent":{"get":{"operationId":"getAdjacentBotIssues","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"required":false,"name":"status","in":"query"}],"responses":{"200":{"description":"Previous and next issue IDs in the ranked open-issues list for the window","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"previousId":{"type":"string","nullable":true,"format":"uuid"},"nextId":{"type":"string","nullable":true,"format":"uuid"}},"required":["previousId","nextId"]}},"required":["data"]}}}},"400":{"description":"Invalid issue window","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}":{"get":{"operationId":"getBotIssue","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"instanceOccurredFrom","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"instanceOccurredTo","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"JSON array of { key, operator, values }. Keys: outcome, topic, version, summary, scorer:{scorerId}, property:{fieldId}. Operators: is, is_not, contains, not_contains."},"required":false,"name":"filters","in":"query"}],"responses":{"200":{"description":"One grouped bot issue with instances and evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"botName":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string","enum":["low","medium","high"]},"category":{"type":"string","enum":["tool","workflow","knowledge","instruction","guardrail","escalation","other"]},"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"source":{"type":"string","enum":["deterministic","model","manual"]},"subjectType":{"type":"string","enum":["action","workflow","intent","other"]},"subjectName":{"type":"string","nullable":true},"outcome":{"type":"string","nullable":true},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"},"instanceCount":{"type":"integer"},"affectedConversationCount":{"type":"integer"},"maturity":{"type":"string","enum":["emerging","mature"]},"foundBy":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["rulebase"]},"name":{"type":"string","enum":["Rulebase"]},"initials":{"nullable":true}},"required":["kind","name","initials"]},{"type":"object","properties":{"kind":{"type":"string","enum":["person"]},"name":{"type":"string"},"initials":{"type":"string"}},"required":["kind","name","initials"]}]},"tags":{"type":"array","items":{"type":"string"}},"verification":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"recommendation":{"type":"object","nullable":true,"properties":{"recommendationId":{"type":"string","format":"uuid"},"reasonId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"title":{"type":"string"},"description":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ticketCount":{"type":"integer"},"estimatedMonthlyContainedTickets":{"type":"integer","minimum":0},"confidence":{"type":"number"}},"required":["recommendationId","reasonId","type","capabilitySubtype","title","description","artifactTitle","artifactContent","acceptanceCriteria","ticketCount","estimatedMonthlyContainedTickets","confidence"]},"dailySeries":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"integer"}},"required":["date","count"]}},"tool":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"displayName":{"type":"string"}},"required":["id","name","displayName"]},"analysis":{"type":"object","properties":{"status":{"type":"string","enum":["pending","ready","failed"]},"sections":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["customer_scenario","agent_limitation","human_resolution","customer_impact","scope_and_confidence"]},"paragraph":{"type":"string"},"evidenceConversationIds":{"type":"array","items":{"type":"integer"}}},"required":["kind","paragraph","evidenceConversationIds"]}},"generatedAt":{"type":"string","nullable":true,"format":"date-time"},"model":{"type":"string","nullable":true},"version":{"type":"integer","nullable":true}},"required":["status","sections","generatedAt","model","version"]},"fixClustersStatus":{"type":"string","enum":["pending","ready","failed"]},"fixClustersGeneratedAt":{"type":"string","nullable":true,"format":"date-time"},"fixClusters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"filteredConversationCount":{"type":"integer","nullable":true},"instances":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true},"railsConversationId":{"type":"integer","nullable":true},"botConversationId":{"type":"string","nullable":true,"format":"uuid"},"botEventId":{"type":"string","nullable":true,"format":"uuid"},"conversationExternalId":{"type":"string","nullable":true},"conversationLabel":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"confidence":{"type":"number","minimum":0,"maximum":1},"status":{"type":"string","enum":["detected","confirmed","dismissed"]},"occurredAt":{"type":"string","format":"date-time"},"conversationStartedAt":{"type":"string","nullable":true,"format":"date-time"},"ticket":{"type":"object","properties":{"status":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"helpdesk":{"type":"string","nullable":true}},"required":["status","url","helpdesk"]},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["trigger","context","outcome","customer_quote","bot_reply"]},"quote":{"type":"string","nullable":true},"data":{"type":"object","additionalProperties":{"nullable":true}},"occurredAt":{"type":"string","nullable":true,"format":"date-time"},"position":{"type":"integer"},"conversationPartId":{"type":"string","nullable":true}},"required":["id","kind","quote","data","occurredAt","position","conversationPartId"]}}},"required":["id","conversationId","railsConversationId","botConversationId","botEventId","conversationExternalId","conversationLabel","customerName","summary","confidence","status","occurredAt","conversationStartedAt","ticket","evidence"]}}},"required":["id","botId","botName","title","description","severity","category","status","source","subjectType","subjectName","outcome","firstSeenAt","lastSeenAt","instanceCount","affectedConversationCount","maturity","foundBy","tags","verification","recommendation","dailySeries","tool","analysis","fixClustersStatus","fixClustersGeneratedAt","fixClusters","filteredConversationCount","instances"]}},"required":["data"]}}}},"400":{"description":"Invalid issue window","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateBotIssueStatus","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","resolved","snoozed","archived"]},"snooze":{"oneOf":[{"type":"object","properties":{"kind":{"type":"string","enum":["time"]},"until":{"type":"string","format":"date-time"}},"required":["kind","until"]},{"type":"object","properties":{"kind":{"type":"string","enum":["cases"]},"moreCases":{"type":"integer","minimum":1,"maximum":10000}},"required":["kind","moreCases"]},{"type":"object","properties":{"kind":{"type":"string","enum":["escalation"]}},"required":["kind"]}]},"assigneeMembershipId":{"type":"string","nullable":true,"format":"uuid"},"assigneeAccountId":{"type":"string","nullable":true},"priority":{"type":"string","nullable":true,"enum":["low","medium","high"]}}}}}},"responses":{"200":{"description":"The issue's triage state after the change","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"},"snooze":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["time","cases","escalation"]},"snoozedAt":{"type":"string","nullable":true,"format":"date-time"},"until":{"type":"string","nullable":true,"format":"date-time"},"untilCaseCount":{"type":"integer","nullable":true}},"required":["kind","snoozedAt","until","untilCaseCount"]},"assignee":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string","format":"uuid"},"name":{"type":"string"},"accountId":{"type":"string","nullable":true}},"required":["membershipId","name","accountId"]},"severity":{"type":"string","enum":["low","medium","high"]},"priorityOverride":{"type":"string","nullable":true,"enum":["low","medium","high"]}},"required":["id","status","resolvedAt","archivedAt","snooze","assignee","severity","priorityOverride"]}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"The change can't be applied","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/impact":{"get":{"operationId":"getBotIssueImpact","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Outcome metrics and topic breakdown for a bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"outcomeStats":{"type":"object","properties":{"version":{"type":"integer","minimum":0,"exclusiveMinimum":true},"comparison":{"type":"string","enum":["same_topic","same_agent"]},"estimatedAffectedConversationCount":{"type":"number","minimum":0},"baselineConversationCount":{"type":"integer","minimum":0},"escalation":{"type":"object","properties":{"rate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"escalatedCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"baselineRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"baselineEligibleCount":{"type":"integer","minimum":0},"delta":{"type":"number","nullable":true,"minimum":-1,"maximum":1},"deltaRange":{"type":"object","nullable":true,"properties":{"lower":{"type":"number"},"upper":{"type":"number"}},"required":["lower","upper"]},"estimatedDeltaCount":{"type":"number","nullable":true},"confidence":{"type":"string","enum":["insufficient","directional","strong"]}},"required":["rate","escalatedCount","eligibleCount","baselineRate","baselineEligibleCount","delta","deltaRange","estimatedDeltaCount","confidence"]},"containment":{"type":"object","properties":{"rate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"containedCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"baselineRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"baselineEligibleCount":{"type":"integer","minimum":0},"delta":{"type":"number","nullable":true,"minimum":-1,"maximum":1},"deltaRange":{"type":"object","nullable":true,"properties":{"lower":{"type":"number"},"upper":{"type":"number"}},"required":["lower","upper"]},"estimatedDeltaCount":{"type":"number","nullable":true},"confidence":{"type":"string","enum":["insufficient","directional","strong"]}},"required":["rate","containedCount","eligibleCount","baselineRate","baselineEligibleCount","delta","deltaRange","estimatedDeltaCount","confidence"]},"resolution":{"type":"object","properties":{"supported":{"type":"boolean"},"rate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"resolvedCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"baselineRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"baselineEligibleCount":{"type":"integer","minimum":0},"delta":{"type":"number","nullable":true,"minimum":-1,"maximum":1},"deltaRange":{"type":"object","nullable":true,"properties":{"lower":{"type":"number"},"upper":{"type":"number"}},"required":["lower","upper"]},"estimatedDeltaCount":{"type":"number","nullable":true},"confidence":{"type":"string","enum":["insufficient","directional","strong"]}},"required":["supported","rate","resolvedCount","eligibleCount","baselineRate","baselineEligibleCount","delta","deltaRange","estimatedDeltaCount","confidence"]},"csat":{"type":"object","properties":{"supported":{"type":"boolean"},"average":{"type":"number","nullable":true,"minimum":0,"maximum":1},"responseCount":{"type":"integer"},"baselineAverage":{"type":"number","nullable":true,"minimum":0,"maximum":1},"baselineMeasuredCount":{"type":"integer","minimum":0},"delta":{"type":"number","nullable":true,"minimum":-1,"maximum":1},"deltaRange":{"type":"object","nullable":true,"properties":{"lower":{"type":"number"},"upper":{"type":"number"}},"required":["lower","upper"]},"confidence":{"type":"string","enum":["insufficient","directional","strong"]}},"required":["supported","average","responseCount","baselineAverage","baselineMeasuredCount","delta","deltaRange","confidence"]},"handlingTime":{"type":"object","properties":{"supported":{"type":"boolean"},"averageSeconds":{"type":"number","nullable":true,"minimum":0},"medianSeconds":{"type":"number","nullable":true,"minimum":0},"measuredCount":{"type":"integer"},"baselineAverageSeconds":{"type":"number","nullable":true,"minimum":0},"baselineMedianSeconds":{"type":"number","nullable":true,"minimum":0},"baselineMeasuredCount":{"type":"integer","minimum":0},"deltaSeconds":{"type":"number","nullable":true},"deltaRangeSeconds":{"type":"object","nullable":true,"properties":{"lower":{"type":"number"},"upper":{"type":"number"}},"required":["lower","upper"]},"estimatedDeltaSeconds":{"type":"number","nullable":true},"basis":{"type":"string","enum":["active_agent_time","time_to_resolution"]},"confidence":{"type":"string","enum":["insufficient","directional","strong"]}},"required":["supported","averageSeconds","medianSeconds","measuredCount","baselineAverageSeconds","baselineMedianSeconds","baselineMeasuredCount","deltaSeconds","deltaRangeSeconds","estimatedDeltaSeconds","basis","confidence"]},"rcsat":{"type":"object","properties":{"supported":{"type":"boolean"},"index":{"type":"number","nullable":true,"minimum":0,"maximum":100},"scoredCount":{"type":"integer"},"eligibleCount":{"type":"integer"},"baselineIndex":{"type":"number","nullable":true,"minimum":0,"maximum":100},"baselineScoredCount":{"type":"integer"},"baselineEligibleCount":{"type":"integer"},"differenceFromBaseline":{"type":"number","nullable":true,"minimum":-100,"maximum":100},"estimatedAffectedShare":{"type":"number","nullable":true,"minimum":0,"maximum":1},"projectedOverallLift":{"type":"number","nullable":true,"minimum":0,"maximum":100},"methodologyVersion":{"type":"number","enum":[1]}},"required":["supported","index","scoredCount","eligibleCount","baselineIndex","baselineScoredCount","baselineEligibleCount","differenceFromBaseline","estimatedAffectedShare","projectedOverallLift","methodologyVersion"]}},"required":["version","comparison","estimatedAffectedConversationCount","baselineConversationCount","escalation","containment","resolution","csat","handlingTime","rcsat"]},"topicBreakdown":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"affectedConversationCount":{"type":"integer"},"share":{"type":"number","minimum":0,"maximum":1}},"required":["name","affectedConversationCount","share"]}}},"required":["outcomeStats","topicBreakdown"]}},"required":["data"]}}}},"400":{"description":"Invalid issue window","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issue-searches":{"post":{"operationId":"createBotIssueSearch","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"type":"string","minLength":10,"maxLength":2000},"botIds":{"type":"array","nullable":true,"items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":20},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["description"]}}}},"responses":{"202":{"description":"Issue search accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"detectorId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"stage":{"type":"string","enum":["queued","retrieving","classifying","clustering","completed"]},"candidateCount":{"type":"integer"},"processedCount":{"type":"integer"},"matchCount":{"type":"integer"},"issueCount":{"type":"integer"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","detectorId","status","stage","candidateCount","processedCount","matchCount","issueCount","error","createdAt","startedAt","finishedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid search window or bot scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"429":{"description":"Issue-search capacity reached","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Issue search could not be queued","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issue-search-runs/latest":{"get":{"operationId":"getLatestBotIssueSearchRun","responses":{"200":{"description":"Most recent issue-search run for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"detectorId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"stage":{"type":"string","enum":["queued","retrieving","classifying","clustering","completed"]},"candidateCount":{"type":"integer"},"processedCount":{"type":"integer"},"matchCount":{"type":"integer"},"issueCount":{"type":"integer"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","detectorId","status","stage","candidateCount","processedCount","matchCount","issueCount","error","createdAt","startedAt","finishedAt"]}},"required":["data"]}}}}}}},"/bot-signals/issue-search-runs/{runId}":{"get":{"operationId":"getBotIssueSearchRun","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Issue-search run progress","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"detectorId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["queued","running","completed","failed"]},"stage":{"type":"string","enum":["queued","retrieving","classifying","clustering","completed"]},"candidateCount":{"type":"integer"},"processedCount":{"type":"integer"},"matchCount":{"type":"integer"},"issueCount":{"type":"integer"},"error":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","detectorId","status","stage","candidateCount","processedCount","matchCount","issueCount","error","createdAt","startedAt","finishedAt"]}},"required":["data"]}}}},"404":{"description":"Unknown issue-search run","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/recommended-fixes":{"get":{"operationId":"getBotIssueRecommendedFixes","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Recommended fixes for a bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["pending","ready","failed"]},"generatedAt":{"type":"string","nullable":true,"format":"date-time"},"clusters":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"rank":{"type":"integer"},"title":{"type":"string"},"type":{"type":"string","enum":["Knowledge base","Tool / capability","Guardrails"]},"issueSummary":{"type":"string","nullable":true},"connectorSignals":{"type":"array","items":{"type":"string"},"default":[]},"conversationCount":{"type":"integer"},"conversationIds":{"type":"array","items":{"type":"integer"}},"sampleSize":{"type":"integer"},"failureRate":{"type":"number"},"fixes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clusterId":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["Knowledge base","Tool / capability","Guardrails"]},"recommendationType":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"conversationCount":{"type":"integer"},"sampleSize":{"type":"integer"},"failureRate":{"type":"number"},"issueSummary":{"type":"string"},"fixLine":{"type":"string"},"requiredSteps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["evidence","fix"]},"title":{"type":"string"},"description":{"type":"string"}},"required":["kind","title","description"]}},"ticketsDeflected":{"type":"integer"},"projectedOutcome":{"type":"string"},"action":{"type":"string","enum":["Draft doc","Update doc","Suggestion"]},"draftTitle":{"type":"string"},"draftContent":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"confidence":{"type":"number"},"estimatedMonthlyContainedTickets":{"type":"integer"},"targetRailsDocumentId":{"type":"string","nullable":true},"targetRailsDocumentTitle":{"type":"string","nullable":true},"status":{"type":"string","enum":["open","accepted","dismissed"]},"acceptedRailsDocumentId":{"type":"string","nullable":true}},"required":["id","clusterId","title","description","type","recommendationType","capabilitySubtype","conversationCount","sampleSize","failureRate","fixLine","requiredSteps","ticketsDeflected","projectedOutcome","action","draftTitle","draftContent","artifactTitle","artifactContent","acceptanceCriteria","confidence","estimatedMonthlyContainedTickets","status","acceptedRailsDocumentId"]}}},"required":["id","rank","title","type","issueSummary","conversationCount","conversationIds","sampleSize","failureRate","fixes"]}},"roi":{"type":"object","properties":{"todayContained":{"type":"integer"},"todayReachesHuman":{"type":"integer"},"todayEligible":{"type":"integer"},"afterContained":{"type":"integer"},"afterReachesHuman":{"type":"integer"},"changeContained":{"type":"integer"},"changeReachesHuman":{"type":"integer"},"headline":{"type":"string"},"metrics":{"type":"array","items":{"type":"string","enum":["resolved_tickets","containment"]}}},"required":["todayContained","todayReachesHuman","todayEligible","afterContained","afterReachesHuman","changeContained","changeReachesHuman","headline","metrics"]}},"required":["status","generatedAt","clusters","roi"]}},"required":["data"]}}}},"400":{"description":"Window too large","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/tags":{"put":{"operationId":"setBotIssueTags","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"maxItems":20}},"required":["tags"]}}}},"responses":{"200":{"description":"The issue's tags after the update","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","tags"]}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issue-tags":{"get":{"operationId":"listBotIssueTags","responses":{"200":{"description":"Tags used on the organization's issues, most used first, for suggestions","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"tag":{"type":"string"},"issueCount":{"type":"integer"}},"required":["tag","issueCount"]}}},"required":["data"]}}}}}}},"/bot-signals/issue-link-providers":{"get":{"operationId":"listBotIssueLinkProviders","responses":{"200":{"description":"Connection status of each tracker an issue can link to","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["github","linear"]},"connected":{"type":"boolean"},"accountName":{"type":"string","nullable":true},"canManage":{"type":"boolean"}},"required":["provider","connected","accountName","canManage"]}}},"required":["data"]}}}}}}},"/bot-signals/issues/{issueId}/links":{"get":{"operationId":"listBotIssueLinks","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"External links on the issue, with provider state","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["github"]},"kind":{"type":"string","enum":["issue","pull_request"]},"repository":{"type":"string"},"number":{"type":"integer"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"state":{"type":"string","enum":["open","closed","merged"]},"additions":{"type":"integer","nullable":true},"deletions":{"type":"integer","nullable":true},"changedFiles":{"type":"integer","nullable":true},"createdAt":{"type":"string"}},"required":["id","provider","kind","repository","number","url","title","state","additions","deletions","changedFiles","createdAt"]}}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"operationId":"linkBotIssueGithubItem","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repository":{"type":"string"},"number":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["repository","number"]}}}},"responses":{"200":{"description":"The linked item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["github"]},"kind":{"type":"string","enum":["issue","pull_request"]},"repository":{"type":"string"},"number":{"type":"integer"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"state":{"type":"string","enum":["open","closed","merged"]},"additions":{"type":"integer","nullable":true},"deletions":{"type":"integer","nullable":true},"changedFiles":{"type":"integer","nullable":true},"createdAt":{"type":"string"}},"required":["id","provider","kind","repository","number","url","title","state","additions","deletions","changedFiles","createdAt"]}},"required":["data"]}}}},"403":{"description":"No access to the repository or item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue, repository or item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/links/github-issue":{"post":{"operationId":"createBotIssueGithubIssue","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"repository":{"type":"string"},"title":{"type":"string","minLength":1,"maxLength":256},"body":{"type":"string","maxLength":65536},"assignees":{"type":"array","items":{"type":"string"},"maxItems":10,"default":[]},"labels":{"type":"array","items":{"type":"string"},"maxItems":20,"default":[]}},"required":["repository","title","body"]}}}},"responses":{"200":{"description":"The linked item","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["github"]},"kind":{"type":"string","enum":["issue","pull_request"]},"repository":{"type":"string"},"number":{"type":"integer"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"state":{"type":"string","enum":["open","closed","merged"]},"additions":{"type":"integer","nullable":true},"deletions":{"type":"integer","nullable":true},"changedFiles":{"type":"integer","nullable":true},"createdAt":{"type":"string"}},"required":["id","provider","kind","repository","number","url","title","state","additions","deletions","changedFiles","createdAt"]}},"required":["data"]}}}},"403":{"description":"No access to the repository or item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue, repository or item","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/links/{linkId}":{"delete":{"operationId":"deleteBotIssueLink","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"linkId","in":"path"}],"responses":{"204":{"description":"Link removed"},"404":{"description":"Unknown bot issue or link","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/triage":{"get":{"operationId":"getBotIssueTriage","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"The issue's status, snooze, owner and priority","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"archivedAt":{"type":"string","nullable":true,"format":"date-time"},"snooze":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["time","cases","escalation"]},"snoozedAt":{"type":"string","nullable":true,"format":"date-time"},"until":{"type":"string","nullable":true,"format":"date-time"},"untilCaseCount":{"type":"integer","nullable":true}},"required":["kind","snoozedAt","until","untilCaseCount"]},"assignee":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string","format":"uuid"},"name":{"type":"string"},"accountId":{"type":"string","nullable":true}},"required":["membershipId","name","accountId"]},"severity":{"type":"string","enum":["low","medium","high"]},"priorityOverride":{"type":"string","nullable":true,"enum":["low","medium","high"]}},"required":["id","status","resolvedAt","archivedAt","snooze","assignee","severity","priorityOverride"]}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/activity":{"get":{"operationId":"listBotIssueActivity","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"What happened on the issue, newest first: detection, escalations, changes and comments","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["comment","status_changed","assignee_changed","priority_changed","link_added","link_removed","detected","escalated"]},"actor":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membershipId","name"]},"createdAt":{"type":"string","format":"date-time"},"body":{"type":"string","nullable":true},"data":{"type":"object","properties":{"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"snooze":{"type":"object","properties":{"kind":{"type":"string","enum":["time","cases","escalation"]},"until":{"type":"string","nullable":true},"untilCaseCount":{"type":"integer","nullable":true}},"required":["kind","until","untilCaseCount"]},"reopenedBy":{"type":"string","enum":["time","cases","escalation"]},"assigneeMembershipId":{"type":"string","nullable":true},"assigneeName":{"type":"string","nullable":true},"priority":{"type":"string","nullable":true,"enum":["low","medium","high"]},"linkLabel":{"type":"string"},"linkUrl":{"type":"string"},"caseCount":{"type":"integer"},"windowHours":{"type":"number"}}}},"required":["id","kind","actor","createdAt","body","data"]}}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/comments":{"post":{"operationId":"createBotIssueComment","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["body"]}}}},"responses":{"201":{"description":"The comment was added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","createdAt"]}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issue-assignees":{"get":{"operationId":"listBotIssueAssignees","responses":{"200":{"description":"People in the organization an issue can be assigned to","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"membershipId":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membershipId","name"]}}},"required":["data"]}}}}}}},"/bot-signals/issues/{issueId}/instance-series":{"get":{"operationId":"getBotIssueInstanceSeries","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"},{"schema":{"type":"integer"},"required":true,"name":"bucketSeconds","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"q","in":"query"},{"schema":{"type":"string","description":"JSON array of { key, operator, values }. Keys: outcome, topic, version, summary, scorer:{scorerId}, property:{fieldId}. Operators: is, is_not, contains, not_contains."},"required":false,"name":"filters","in":"query"}],"responses":{"200":{"description":"Instance counts per bucket; empty buckets are omitted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"bucketSeconds":{"type":"integer"},"totals":{"type":"object","properties":{"cases":{"type":"integer"},"users":{"type":"integer"}},"required":["cases","users"]},"buckets":{"type":"array","items":{"type":"object","properties":{"start":{"type":"string","format":"date-time"},"count":{"type":"integer"},"users":{"type":"integer"}},"required":["start","count","users"]}}},"required":["from","to","bucketSeconds","totals","buckets"]}},"required":["data"]}}}},"400":{"description":"Range too long or bucket too small for it","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/case-filter-options":{"get":{"operationId":"getBotIssueCaseFilterOptions","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"What the issue's cases in the range can be filtered by, with the values they have","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"group":{"type":"string","enum":["case","scorer","property"]},"values":{"type":"array","items":{"type":"object","properties":{"value":{"type":"string"},"count":{"type":"integer"}},"required":["value","count"]}}},"required":["key","label","group","values"]}}},"required":["data"]}}}},"400":{"description":"Range too long","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/similar":{"get":{"operationId":"listSimilarBotIssues","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"}],"responses":{"200":{"description":"Issues on the same agent that share conversations or a subject with this one","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"status":{"type":"string","enum":["open","resolved","dismissed","snoozed","archived"]},"caseCount":{"type":"integer"},"sharedCaseCount":{"type":"integer"},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["id","title","status","caseCount","sharedCaseCount","lastSeenAt"]}}},"required":["data"]}}}},"404":{"description":"Unknown bot issue","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/github/repositories":{"get":{"operationId":"listBotIssueGithubRepositories","parameters":[{"schema":{"type":"string","maxLength":100},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Repositories the connected GitHub account can use","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"fullName":{"type":"string"},"private":{"type":"boolean"},"hasIssues":{"type":"boolean"}},"required":["fullName","private","hasIssues"]}}},"required":["data"]}}}},"403":{"description":"No access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/github/search":{"get":{"operationId":"searchBotIssueGithubItems","parameters":[{"schema":{"type":"string"},"required":true,"name":"repository","in":"query"},{"schema":{"type":"string","maxLength":200,"default":""},"required":false,"name":"q","in":"query"}],"responses":{"200":{"description":"Issues and pull requests matching the search","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["issue","pull_request"]},"repository":{"type":"string"},"number":{"type":"integer"},"url":{"type":"string","format":"uri"},"title":{"type":"string"},"state":{"type":"string","enum":["open","closed","merged"]}},"required":["kind","repository","number","url","title","state"]}}},"required":["data"]}}}},"403":{"description":"No access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/github/assignees":{"get":{"operationId":"listBotIssueGithubAssignees","parameters":[{"schema":{"type":"string"},"required":true,"name":"repository","in":"query"}],"responses":{"200":{"description":"Assignable users, as logins","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"403":{"description":"No access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/github/labels":{"get":{"operationId":"listBotIssueGithubLabels","parameters":[{"schema":{"type":"string"},"required":true,"name":"repository","in":"query"}],"responses":{"200":{"description":"Label names in the repository","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"403":{"description":"No access","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"GitHub is not connected","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"GitHub rejected the request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"GitHub request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/cases/{instanceId}":{"get":{"operationId":"getBotIssueCase","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instanceId","in":"path"}],"responses":{"200":{"description":"One case: its ticket, conversation, rubric verdicts and cause","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"string","nullable":true}},"required":["id","name","version"]},"ticket":{"type":"object","nullable":true,"properties":{"reference":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"helpdesk":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"closedAt":{"type":"string","nullable":true,"format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"customerName":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"contained":{"type":"boolean","nullable":true},"handedOffAt":{"type":"string","nullable":true,"format":"date-time"},"firstHumanReplyAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["reference","url","helpdesk","status","startedAt","closedAt","resolvedAt","customerName","tags","contained","handedOffAt","firstHumanReplyAt"]},"outcome":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["contained","handed_off","timed_out","open"]},"handoffWaitSeconds":{"type":"integer","nullable":true}},"required":["kind","handoffWaitSeconds"]},"closure":{"type":"object","nullable":true,"properties":{"by":{"type":"string","enum":["agent","human","timeout"]},"at":{"type":"string","format":"date-time"}},"required":["by","at"]},"properties":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"ticketEvents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"kind":{"type":"string","enum":["field","status","group","tags"]},"label":{"type":"string"},"value":{"type":"string","nullable":true},"previousValue":{"type":"string","nullable":true},"addedTags":{"type":"array","items":{"type":"string"}},"removedTags":{"type":"array","items":{"type":"string"}}},"required":["id","occurredAt","kind","label","value","previousValue","addedTags","removedTags"]}},"handoffReason":{"type":"object","nullable":true,"properties":{"gapType":{"type":"string"},"title":{"type":"string"},"why":{"type":"string"}},"required":["gapType","title","why"]},"parts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"occurredAt":{"type":"string"},"actor":{"type":"string","enum":["self","customer","human_agent","other_bot","system"]},"kind":{"type":"string","enum":["message","note","tool_call","handoff","assignment","csat"]},"visibility":{"type":"string","enum":["public","internal"]},"authorName":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"contentEnglish":{"type":"string","nullable":true},"data":{"type":"object","additionalProperties":{"nullable":true}},"botEventId":{"type":"string","nullable":true}},"required":["id","seq","occurredAt","actor","kind","visibility","authorName","content","contentEnglish","data","botEventId"]}},"translation":{"type":"object","nullable":true,"properties":{"status":{"type":"string"},"sourceLanguage":{"type":"string","nullable":true}},"required":["status","sourceLanguage"]},"annotations":{"type":"array","items":{"type":"object","properties":{"partId":{"type":"string"},"rubrics":{"type":"array","items":{"type":"string"}},"notes":{"type":"array","items":{"type":"string"}}},"required":["partId","rubrics","notes"]}},"review":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","title","summary","completedAt"]},"rubric":{"type":"array","items":{"type":"object","properties":{"scorerId":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"value":{"type":"number"},"passed":{"type":"boolean"},"reason":{"type":"string","nullable":true},"partIds":{"type":"array","items":{"type":"string"}}},"required":["scorerId","name","type","value","passed","reason","partIds"]}},"id":{"type":"string","format":"uuid"},"issueId":{"type":"string","format":"uuid"},"occurredAt":{"type":"string","format":"date-time"},"summary":{"type":"string","nullable":true},"citation":{"type":"object","nullable":true,"properties":{"partId":{"type":"string","nullable":true},"agentQuote":{"type":"string"},"documentQuote":{"type":"string"},"document":{"type":"object","properties":{"id":{"type":"string","nullable":true},"title":{"type":"string"},"url":{"type":"string","nullable":true},"sourceType":{"type":"string","nullable":true},"section":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true,"format":"date-time"},"excerpt":{"type":"object","properties":{"before":{"type":"string"},"quote":{"type":"string"},"after":{"type":"string"}},"required":["before","quote","after"]},"citedCaseCount":{"type":"integer"}},"required":["id","title","url","sourceType","section","updatedAt","excerpt","citedCaseCount"]}},"required":["partId","agentQuote","documentQuote","document"]},"cause":{"type":"object","properties":{"kind":{"type":"string","enum":["tool","knowledge","agent","escalation","trace","rubric","other"]},"title":{"type":"string"},"detail":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"partId":{"type":"string","nullable":true}},"required":["kind","title","detail","toolName","partId"]}},"required":["agent","ticket","outcome","closure","properties","ticketEvents","handoffReason","parts","translation","annotations","review","rubric","id","issueId","occurredAt","summary","citation","cause"]}},"required":["data"]}}}},"404":{"description":"Unknown issue or case","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issues/{issueId}/cases/{instanceId}/translate":{"post":{"operationId":"translateBotIssueCase","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"issueId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"instanceId","in":"path"}],"responses":{"202":{"description":"An English translation of the case's conversation was requested","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"]}},"required":["data"]}}}},"404":{"description":"Unknown issue or case, or a case without a conversation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/tools/{toolId}/summary":{"get":{"operationId":"getBotToolSummary","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"toolId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"executionId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Recent calls, failures, latency and one execution for a bot tool","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"tool":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"name":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string","nullable":true},"firstSeenAt":{"type":"string","format":"date-time"},"lastSeenAt":{"type":"string","format":"date-time"}},"required":["id","botId","name","displayName","description","firstSeenAt","lastSeenAt"]},"windowDays":{"type":"integer"},"calls":{"type":"integer"},"failed":{"type":"integer"},"unknown":{"type":"integer"},"medianLatencyMs":{"type":"integer","nullable":true},"topError":{"type":"object","nullable":true,"properties":{"label":{"type":"string"},"count":{"type":"integer"}},"required":["label","count"]},"execution":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"occurredAt":{"type":"string","format":"date-time"},"outcome":{"type":"string","enum":["succeeded","failed","unknown"]},"latencyMs":{"type":"integer","nullable":true},"httpStatus":{"type":"integer","nullable":true},"httpMethod":{"type":"string","nullable":true},"errorType":{"type":"string","nullable":true},"errorMessage":{"type":"string","nullable":true},"railsConversationId":{"type":"integer","nullable":true},"botConversationId":{"type":"string","nullable":true,"format":"uuid"}},"required":["id","occurredAt","outcome","latencyMs","httpStatus","httpMethod","errorType","errorMessage","railsConversationId","botConversationId"]}},"required":["tool","windowDays","calls","failed","unknown","medianLatencyMs","topError","execution"]}},"required":["data"]}}}},"404":{"description":"Unknown bot tool","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/opportunities":{"get":{"operationId":"listBotOpportunities","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":50,"default":50},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Canonical cross-topic improvement opportunities","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"opportunityId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"title":{"type":"string"},"description":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ticketCount":{"type":"integer","minimum":0},"affectedTopicCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sourceRecommendationCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"estimatedMonthlyAffectedTickets":{"type":"integer","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1},"affectedTopics":{"type":"array","items":{"type":"object","properties":{"topicId":{"type":"string","format":"uuid"},"name":{"type":"string"},"recommendationCount":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["topicId","name","recommendationCount"]}}},"required":["opportunityId","type","capabilitySubtype","title","description","artifactTitle","artifactContent","acceptanceCriteria","ticketCount","affectedTopicCount","sourceRecommendationCount","estimatedMonthlyAffectedTickets","confidence","affectedTopics"]}},"total":{"type":"integer","minimum":0}},"required":["data","total"]}}}}}}},"/bot-signals/opportunities/{opportunityId}":{"get":{"operationId":"getBotOpportunity","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"opportunityId","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"}],"responses":{"200":{"description":"One canonical opportunity and its topic-level evidence","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"opportunityId":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["knowledge","instruction","capability"]},"capabilitySubtype":{"type":"string","nullable":true,"enum":["read","action","repair"]},"title":{"type":"string"},"description":{"type":"string"},"artifactTitle":{"type":"string"},"artifactContent":{"type":"string"},"acceptanceCriteria":{"type":"array","items":{"type":"string"}},"ticketCount":{"type":"integer","minimum":0},"affectedTopicCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sourceRecommendationCount":{"type":"integer","minimum":0,"exclusiveMinimum":true},"estimatedMonthlyAffectedTickets":{"type":"integer","minimum":0},"confidence":{"type":"number","minimum":0,"maximum":1},"affectedTopics":{"type":"array","items":{"type":"object","properties":{"topicId":{"type":"string","format":"uuid"},"name":{"type":"string"},"recommendationCount":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["topicId","name","recommendationCount"]}},"sourceRecommendations":{"type":"array","items":{"type":"object","properties":{"recommendationId":{"type":"string","format":"uuid"},"topicId":{"type":"string","format":"uuid"},"topicName":{"type":"string"},"reasonId":{"type":"string","format":"uuid"},"reasonName":{"type":"string"},"reasonDescription":{"type":"string"},"recommendationTitle":{"type":"string"}},"required":["recommendationId","topicId","topicName","reasonId","reasonName","reasonDescription","recommendationTitle"]}},"evidence":{"type":"array","items":{"type":"object","properties":{"conversationId":{"type":"string"},"externalId":{"type":"string","nullable":true},"summary":{"type":"string"},"topicId":{"type":"string","format":"uuid"},"topicName":{"type":"string"},"reasonName":{"type":"string"}},"required":["conversationId","externalId","summary","topicId","topicName","reasonName"]}}},"required":["opportunityId","type","capabilitySubtype","title","description","artifactTitle","artifactContent","acceptanceCriteria","ticketCount","affectedTopicCount","sourceRecommendationCount","estimatedMonthlyAffectedTickets","confidence","affectedTopics","sourceRecommendations","evidence"]}},"required":["data"]}}}},"404":{"description":"Unknown opportunity","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-signals/issue-checks":{"get":{"operationId":"listBotIssueChecks","parameters":[{"schema":{"type":"string","format":"date-time"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Daily issue detector checks in the reporting window","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"total":{"type":"integer"},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"integer"}},"required":["date","count"]}}},"required":["total","series"]}},"required":["data"]}}}},"400":{"description":"Invalid issue check window","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots":{"get":{"operationId":"listBots","responses":{"200":{"description":"Bots","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"displayName":{"type":"string"},"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"active":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["helpdesk","observability"]},"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"accountName":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"seat":{"type":"object","nullable":true,"properties":{"agentIntegrationProfileId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["agentIntegrationProfileId","name","email"]}},"required":["id","type","connectionId","provider","accountName","isPrimary","project","seat"]}}},"required":["id","name","displayName","provider","active","connections"]}}},"required":["data"]}}}}}},"post":{"operationId":"createBot","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"botProviderId":{"type":"string","format":"uuid"},"connections":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["helpdesk"]},"connectionId":{"type":"string","format":"uuid"},"agentIntegrationProfileId":{"type":"string","minLength":1}},"required":["type","connectionId","agentIntegrationProfileId"]},{"type":"object","properties":{"type":{"type":"string","enum":["observability"]},"connectionId":{"type":"string","format":"uuid"},"projectId":{"type":"string","minLength":1},"projectName":{"type":"string","minLength":1}},"required":["type","connectionId","projectId","projectName"]}]},"default":[]}},"required":["name"],"additionalProperties":false}}}},"responses":{"201":{"description":"Bot created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"displayName":{"type":"string"},"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"active":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["helpdesk","observability"]},"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"accountName":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"seat":{"type":"object","nullable":true,"properties":{"agentIntegrationProfileId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["agentIntegrationProfileId","name","email"]}},"required":["id","type","connectionId","provider","accountName","isPrimary","project","seat"]}}},"required":["id","name","displayName","provider","active","connections"]}},"required":["data"]}}}},"400":{"description":"Invalid employee","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Seat already linked","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots/helpdesk-directory/sync":{"post":{"operationId":"syncBotHelpdeskDirectory","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"}},"required":["connectionId"],"additionalProperties":false}}}},"responses":{"200":{"description":"Help desk employee directory is ready","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"provider":{"type":"string"},"imported":{"type":"number"}},"required":["provider","imported"]}},"required":["data"]}}}},"400":{"description":"Connection could not be synced","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots/helpdesk-directory/seats":{"get":{"operationId":"listBotHelpdeskSeats","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Help desk seats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["id","name","email"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"string","nullable":true},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Connection is not linked to a help desk directory","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots/{id}":{"patch":{"operationId":"updateBot","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"botProviderId":{"type":"string","format":"uuid"},"active":{"type":"boolean"}},"additionalProperties":false}}}},"responses":{"200":{"description":"Bot updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"displayName":{"type":"string"},"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"active":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["helpdesk","observability"]},"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"accountName":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"seat":{"type":"object","nullable":true,"properties":{"agentIntegrationProfileId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["agentIntegrationProfileId","name","email"]}},"required":["id","type","connectionId","provider","accountName","isPrimary","project","seat"]}}},"required":["id","name","displayName","provider","active","connections"]}},"required":["data"]}}}},"400":{"description":"Invalid update","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Seat already linked","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteBot","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Bot deleted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots/{id}/connections":{"post":{"operationId":"addBotConnection","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["helpdesk"]},"connectionId":{"type":"string","format":"uuid"},"agentIntegrationProfileId":{"type":"string","minLength":1}},"required":["type","connectionId","agentIntegrationProfileId"]},{"type":"object","properties":{"type":{"type":"string","enum":["observability"]},"connectionId":{"type":"string","format":"uuid"},"projectId":{"type":"string","minLength":1},"projectName":{"type":"string","minLength":1}},"required":["type","connectionId","projectId","projectName"]}]}}}},"responses":{"200":{"description":"Bot connection added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"displayName":{"type":"string"},"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"active":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["helpdesk","observability"]},"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"accountName":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"seat":{"type":"object","nullable":true,"properties":{"agentIntegrationProfileId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["agentIntegrationProfileId","name","email"]}},"required":["id","type","connectionId","provider","accountName","isPrimary","project","seat"]}}},"required":["id","name","displayName","provider","active","connections"]}},"required":["data"]}}}},"400":{"description":"Invalid connection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Connection already linked","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bots/{id}/connections/{botConnectionId}":{"delete":{"operationId":"deleteBotConnection","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botConnectionId","in":"path"}],"responses":{"200":{"description":"Bot connection removed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"displayName":{"type":"string"},"provider":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"slug":{"type":"string"},"name":{"type":"string"}},"required":["id","slug","name"]},"active":{"type":"boolean"},"connections":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["helpdesk","observability"]},"connectionId":{"type":"string","format":"uuid"},"provider":{"type":"string"},"accountName":{"type":"string","nullable":true},"isPrimary":{"type":"boolean"},"project":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"seat":{"type":"object","nullable":true,"properties":{"agentIntegrationProfileId":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true}},"required":["agentIntegrationProfileId","name","email"]}},"required":["id","type","connectionId","provider","accountName","isPrimary","project","seat"]}}},"required":["id","name","displayName","provider","active","connections"]}},"required":["data"]}}}},"404":{"description":"Bot connection not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-releases":{"get":{"operationId":"listBotReleases","responses":{"200":{"description":"Agent monitoring releases","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"releasedOn":{"type":"string"},"releasedAt":{"type":"string","nullable":true},"commitSha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"source":{"type":"string","enum":["manual","api"]},"createdAt":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","name","releasedOn","releasedAt","commitSha","notes","source","createdAt","agent"]}}},"required":["data"]}}}}}},"post":{"operationId":"createBotRelease","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"releasedOn":{"type":"string","format":"date"},"releasedAt":{"type":"string","format":"date-time"},"commitSha":{"type":"string","minLength":7,"maxLength":64},"notes":{"type":"string","maxLength":2000}},"required":["botId","name"],"additionalProperties":false}}}},"responses":{"200":{"description":"A release for this commit or name already exists","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"releasedOn":{"type":"string"},"releasedAt":{"type":"string","nullable":true},"commitSha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"source":{"type":"string","enum":["manual","api"]},"createdAt":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","name","releasedOn","releasedAt","commitSha","notes","source","createdAt","agent"]}},"required":["data"]}}}},"201":{"description":"Release created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"releasedOn":{"type":"string"},"releasedAt":{"type":"string","nullable":true},"commitSha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"source":{"type":"string","enum":["manual","api"]},"createdAt":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","name","releasedOn","releasedAt","commitSha","notes","source","createdAt","agent"]}},"required":["data"]}}}},"404":{"description":"Agent not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/bot-releases/{id}":{"patch":{"operationId":"updateBotRelease","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"releasedOn":{"type":"string","format":"date"}},"required":["name","releasedOn"],"additionalProperties":false}}}},"responses":{"200":{"description":"Release updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"releasedOn":{"type":"string"},"releasedAt":{"type":"string","nullable":true},"commitSha":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"source":{"type":"string","enum":["manual","api"]},"createdAt":{"type":"string"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","name","releasedOn","releasedAt","commitSha","notes","source","createdAt","agent"]}},"required":["data"]}}}},"404":{"description":"Release not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteBotRelease","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Release deleted","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]}},"required":["success"]}}}},"404":{"description":"Release not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/setup/complete":{"post":{"operationId":"completeAgentMonitoringSetup","responses":{"200":{"description":"Agent monitoring setup completed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agentMonitoringSetupStatus":{"type":"string","enum":["completed"]}},"required":["agentMonitoringSetupStatus"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/events":{"get":{"operationId":"listAgentMonitoringEvents","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"releaseId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Canonical agent events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true},"railsConversationId":{"type":"integer","nullable":true},"title":{"type":"string"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"customer":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}},"required":["id","name"]},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["id","botConversationId","conversationId","railsConversationId","title","origin","inputMessages","outputMessages","startedAt","endedAt","durationMs","customer","agent"]}},"meta":{"type":"object","properties":{"nextCursor":{"type":"string","nullable":true,"format":"uuid"}},"required":["nextCursor"]}},"required":["data","meta"]}}}}}}},"/agent-monitoring/events/{eventId}":{"get":{"operationId":"getAgentMonitoringEvent","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"eventId","in":"path"}],"responses":{"200":{"description":"A canonical agent event","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true},"railsConversationId":{"type":"integer","nullable":true},"title":{"type":"string"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"customer":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}},"required":["id","name"]},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"traces":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["trace"]},"connectionId":{"type":"string","format":"uuid"},"externalTraceId":{"type":"string"},"botConversationId":{"type":"string","nullable":true,"format":"uuid"},"provider":{"type":"string"},"title":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"status":{"type":"string","nullable":true},"statusMessage":{"type":"string","nullable":true},"spanCount":{"type":"integer","minimum":0},"toolCallCount":{"type":"integer","minimum":0},"failedSpanCount":{"type":"integer","minimum":0},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["type","connectionId","externalTraceId","botConversationId","provider","title","startedAt","endedAt","durationMs","status","statusMessage","spanCount","toolCallCount","failedSpanCount","agent"]}}},"required":["id","botConversationId","conversationId","railsConversationId","title","origin","inputMessages","outputMessages","startedAt","endedAt","durationMs","customer","agent","traces"]}},"required":["data"]}}}}}}},"/agent-monitoring/reconciliation":{"get":{"operationId":"getAgentMonitoringReconciliation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"}],"responses":{"200":{"description":"Bot conversation identity reconciliation diagnostics","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"helpdeskAndTrace":{"type":"integer","minimum":0},"helpdeskOnly":{"type":"integer","minimum":0},"traceOnly":{"type":"integer","minimum":0},"ambiguous":{"type":"integer","minimum":0},"unmatched":{"type":"integer","minimum":0}},"required":["helpdeskAndTrace","helpdeskOnly","traceOnly","ambiguous","unmatched"]}},"required":["data"]}}}}}}},"/agent-monitoring/logs":{"get":{"operationId":"listAgentMonitoringLogs","parameters":[{"schema":{"type":"string","enum":["interactions","traces"],"default":"interactions"},"required":false,"name":"kind","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"releaseId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Agent monitoring interaction and trace logs","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["interaction"]},"botConversationId":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true},"railsConversationId":{"type":"integer","nullable":true},"title":{"type":"string"},"externalId":{"type":"string","nullable":true},"channel":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"contained":{"type":"boolean","nullable":true},"resolutionStatus":{"type":"string","nullable":true},"resolutionOutcome":{"type":"string","nullable":true},"toolCallCount":{"type":"integer","minimum":0},"failedToolCallCount":{"type":"integer","minimum":0},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["type","botConversationId","conversationId","railsConversationId","title","externalId","channel","startedAt","endedAt","durationMs","contained","resolutionStatus","resolutionOutcome","toolCallCount","failedToolCallCount","agent"]},{"type":"object","properties":{"type":{"type":"string","enum":["trace"]},"connectionId":{"type":"string","format":"uuid"},"externalTraceId":{"type":"string"},"botConversationId":{"type":"string","nullable":true,"format":"uuid"},"provider":{"type":"string"},"title":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"status":{"type":"string","nullable":true},"statusMessage":{"type":"string","nullable":true},"spanCount":{"type":"integer","minimum":0},"toolCallCount":{"type":"integer","minimum":0},"failedSpanCount":{"type":"integer","minimum":0},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["type","connectionId","externalTraceId","botConversationId","provider","title","startedAt","endedAt","durationMs","status","statusMessage","spanCount","toolCallCount","failedSpanCount","agent"]}]}}},"required":["data"]}}}}}}},"/agent-monitoring/interaction":{"get":{"operationId":"getAgentMonitoringInteraction","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"botConversationId","in":"query"}],"responses":{"200":{"description":"A canonical agent interaction and its source activity","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"source":{"type":"string","enum":["helpdesk","trace","helpdesk_and_trace"]},"conversationId":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"helpdesk":{"type":"string","nullable":true},"release":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"externalEventId":{"type":"string","nullable":true},"inputMessages":{"type":"array","items":{"nullable":true}},"outputMessages":{"type":"array","items":{"nullable":true}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","origin","externalEventId","inputMessages","outputMessages","startedAt","endedAt"]}},"activity":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["message","trace"]},"at":{"type":"string","format":"date-time"},"actor":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string","nullable":true},"connectionId":{"type":"string","nullable":true,"format":"uuid"},"externalTraceId":{"type":"string","nullable":true}},"required":["id","kind","at","actor","title","content","connectionId","externalTraceId"]}}},"required":["id","title","startedAt","endedAt","durationMs","source","conversationId","externalId","helpdesk","release","agent","events","activity"]}},"required":["data"]}}}}}}},"/agent-monitoring/trace":{"get":{"operationId":"getAgentMonitoringTrace","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"connectionId","in":"query"},{"schema":{"type":"string","minLength":1},"required":true,"name":"externalTraceId","in":"query"}],"responses":{"200":{"description":"A provider trace and its spans","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"spans":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"parentId":{"type":"string","nullable":true},"kind":{"type":"string"},"name":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"durationMs":{"type":"integer","nullable":true,"minimum":0},"status":{"type":"string","nullable":true},"statusMessage":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"output":{"type":"string","nullable":true},"toolName":{"type":"string","nullable":true},"model":{"type":"string","nullable":true}},"required":["id","parentId","kind","name","startedAt","endedAt","durationMs","status","statusMessage","input","output","toolName","model"]}}},"required":["spans"]}},"required":["data"]}}}}}}},"/agent-monitoring/reviews":{"get":{"operationId":"listAgentMonitoringReviews","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"previousFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"previousTo","in":"query"},{"schema":{"type":"string","enum":["pending","running","completed","failed"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"failedScorerId","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Conversation scoring runs and scorer trends","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"scorers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"enabled":{"type":"boolean"}},"required":["id","name","type","enabled"]}},"totalRuns":{"type":"integer","minimum":0},"reviewedConversations":{"type":"integer","minimum":0},"eligibleConversations":{"type":"integer","minimum":0},"runs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"date":{"type":"string","format":"date-time"},"ranAt":{"type":"string","format":"date-time"},"sampledOn":{"type":"string","format":"date"},"error":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"railsConversationId":{"type":"integer","nullable":true},"traceGroupKey":{"type":"string","nullable":true},"customerAsked":{"type":"string","nullable":true}},"required":["railsConversationId","traceGroupKey","customerAsked"]},"scores":{"type":"array","items":{"type":"object","properties":{"scorerId":{"type":"string","format":"uuid"},"value":{"type":"number","minimum":0,"maximum":1}},"required":["scorerId","value"]}}},"required":["id","botConversationId","status","date","ranAt","sampledOn","error","agent","conversation","scores"]}},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"scorerId":{"type":"string","format":"uuid"},"average":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0}},"required":["date","scorerId","average","count"]}},"previousTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"scorerId":{"type":"string","format":"uuid"},"average":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0}},"required":["date","scorerId","average","count"]}}},"required":["scorers","totalRuns","reviewedConversations","eligibleConversations","runs","trend","previousTrend"]}},"required":["data"]}}}}}}},"/agent-monitoring/scorer-trends":{"get":{"operationId":"listAgentMonitoringScorerTrends","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"previousFrom","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"previousTo","in":"query"}],"responses":{"200":{"description":"Scorer averages per day, with the previous period","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"scorers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"enabled":{"type":"boolean"}},"required":["id","name","type","enabled"]}},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"scorerId":{"type":"string","format":"uuid"},"average":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0}},"required":["date","scorerId","average","count"]}},"previousTrend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string","format":"date"},"scorerId":{"type":"string","format":"uuid"},"average":{"type":"number","minimum":0,"maximum":1},"count":{"type":"integer","minimum":0}},"required":["date","scorerId","average","count"]}}},"required":["scorers","trend","previousTrend"]}},"required":["data"]}}}}}}},"/agent-monitoring/reviews/{runId}":{"get":{"operationId":"getAgentMonitoringReview","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"Conversation scoring run detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"status":{"type":"string","enum":["pending","running","completed","failed"]},"attempt":{"type":"integer","minimum":0,"exclusiveMinimum":true},"sampledOn":{"type":"string","format":"date"},"model":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"completedAt":{"type":"string","nullable":true,"format":"date-time"},"error":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"annotatedAt":{"type":"string","nullable":true,"format":"date-time"},"betterReplies":{"type":"array","items":{"type":"object","properties":{"partId":{"type":"string"},"reply":{"type":"string"},"replyEnglish":{"type":"string","nullable":true},"sourceTitle":{"type":"string","nullable":true},"sourceUrl":{"type":"string","nullable":true}},"required":["partId","reply","replyEnglish","sourceTitle","sourceUrl"]}},"previousRunId":{"type":"string","nullable":true,"format":"uuid"},"nextRunId":{"type":"string","nullable":true,"format":"uuid"},"attempts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"attempt":{"type":"integer","minimum":0,"exclusiveMinimum":true},"status":{"type":"string","enum":["pending","running","completed","failed"]},"createdAt":{"type":"string","format":"date-time"}},"required":["id","attempt","status","createdAt"]}},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"string","nullable":true}},"required":["id","name","version"]},"customer":{"type":"object","properties":{"name":{"type":"string","nullable":true}},"required":["name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"traceGroupKey":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"channel":{"type":"string","nullable":true},"handoff":{"type":"object","nullable":true,"properties":{"occurredAt":{"type":"string","format":"date-time"},"to":{"type":"string","nullable":true}},"required":["occurredAt","to"]},"csat":{"type":"object","nullable":true,"properties":{"score":{"type":"number","nullable":true},"providerScore":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true}},"required":["score","providerScore","comment"]},"translation":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["pending","completed","failed"]},"sourceLanguage":{"type":"string","nullable":true}},"required":["status","sourceLanguage"]},"parts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"occurredAt":{"type":"string","format":"date-time"},"actor":{"type":"string","enum":["self","customer","human_agent","other_bot","system"]},"kind":{"type":"string","enum":["message","note","tool_call","handoff","assignment","csat"]},"visibility":{"type":"string","enum":["public","internal"]},"authorName":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"contentEnglish":{"type":"string","nullable":true},"data":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"channel":{"type":"string","nullable":true}},"required":["type","channel"]},{"type":"object","properties":{"type":{"type":"string","enum":["note"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["tool_call"]},"toolName":{"type":"string"},"outcome":{"type":"string"},"lifecycleCoverage":{"type":"string"},"providerResult":{"type":"string","nullable":true}},"required":["type","toolName","outcome","lifecycleCoverage","providerResult"]},{"type":"object","properties":{"type":{"type":"string","enum":["handoff","assignment"]},"assignedTo":{"type":"string","nullable":true},"assignedEmployeeId":{"type":"integer","nullable":true},"teamId":{"type":"integer","nullable":true},"teamName":{"type":"string","nullable":true}},"required":["type","assignedTo","assignedEmployeeId","teamId","teamName"]},{"type":"object","properties":{"type":{"type":"string","enum":["csat"]},"score":{"type":"number","nullable":true},"providerScore":{"type":"string","nullable":true},"comment":{"type":"string","nullable":true}},"required":["type","score","providerScore","comment"]}]},"botEventId":{"type":"string","nullable":true,"format":"uuid"}},"required":["id","seq","occurredAt","actor","kind","visibility","authorName","content","contentEnglish","data","botEventId"]}}},"required":["id","railsConversationId","traceGroupKey","startedAt","endedAt","channel","handoff","csat","translation","parts"]},"scores":{"type":"array","items":{"type":"object","properties":{"scorerId":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"value":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evidence":{"type":"object","properties":{"botEventIds":{"type":"array","items":{"type":"string","format":"uuid"}},"traceSpans":{"type":"array","items":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"},"externalTraceId":{"type":"string"},"externalSpanId":{"type":"string"}},"required":["connectionId","externalTraceId","externalSpanId"]}},"quotes":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"botEventId":{"type":"string","format":"uuid"}},"required":["text"]}},"annotations":{"type":"array","items":{"type":"object","properties":{"partId":{"type":"string"},"quote":{"type":"string"},"note":{"type":"string"}},"required":["partId","quote","note"]}}}}},"required":["scorerId","name","type","value","reason","evidence"]}}},"required":["id","status","attempt","sampledOn","model","createdAt","completedAt","error","title","summary","annotatedAt","betterReplies","previousRunId","nextRunId","attempts","agent","customer","conversation","scores"]}},"required":["data"]}}}},"404":{"description":"Review run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/reviews/{runId}/rerun":{"post":{"operationId":"rerunAgentMonitoringReview","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"202":{"description":"A new attempt was queued for this conversation","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"runId":{"type":"string","format":"uuid"}},"required":["runId"]}},"required":["data"]}}}},"404":{"description":"Review run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"This run can't be re-run","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/reviews/{runId}/translate":{"post":{"operationId":"translateAgentMonitoringReview","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"runId","in":"path"}],"responses":{"202":{"description":"An English translation of the run's conversation was requested","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"]}},"required":["data"]}}}},"404":{"description":"Review run not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities":{"get":{"operationId":"listAgentMonitoringCapabilities","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Capabilities for one agent with computed status and volumes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","nullable":true,"properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"window":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"days":{"type":"integer"}},"required":["from","to","days"]},"summary":{"type":"object","properties":{"notDonePerMonth":{"type":"integer"},"workingPerMonth":{"type":"integer"},"policyPerMonth":{"type":"integer"},"failingPerMonth":{"type":"integer"},"gapsPerMonth":{"type":"integer"},"beingWorkedOnPerMonth":{"type":"integer"},"handledEndToEnd":{"type":"object","properties":{"share":{"type":"number","nullable":true},"changePoints":{"type":"integer","nullable":true},"weekly":{"type":"array","items":{"type":"object","properties":{"week":{"type":"string"},"share":{"type":"number"}},"required":["week","share"]}}},"required":["share","changePoints","weekly"]},"missingPerMonth":{"type":"integer"},"missingByType":{"type":"object","properties":{"data":{"type":"integer"},"action":{"type":"integer"},"knowledge":{"type":"integer"}},"required":["data","action","knowledge"]},"biggestGap":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"failedPerMonth":{"type":"integer"}},"required":["id","name","failedPerMonth"]}},"required":["notDonePerMonth","workingPerMonth","policyPerMonth","failingPerMonth","gapsPerMonth","beingWorkedOnPerMonth","handledEndToEnd","missingPerMonth","missingByType","biggestGap"]},"capabilities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["knowledge","data","action"]},"owner":{"type":"string","nullable":true},"status":{"type":"string","enum":["missing","failing","working","policy","not_enough_evidence"]},"samples":{"type":"integer"},"lowConfidence":{"type":"boolean"},"failedPerMonth":{"type":"integer"},"handledPerMonth":{"type":"integer"},"primaryTopic":{"type":"string","nullable":true},"otherTopicCount":{"type":"integer"},"topics":{"type":"array","items":{"type":"string"}},"linked":{"type":"boolean"},"regressedIn":{"type":"string","nullable":true}},"required":["id","name","description","type","owner","status","samples","lowConfidence","failedPerMonth","handledPerMonth","primaryTopic","otherTopicCount","topics","linked","regressedIn"]}}},"required":["agent","window","summary","capabilities"]}},"required":["data"]}}}}}}},"/agent-monitoring/capabilities/{id}":{"get":{"operationId":"getAgentMonitoringCapability","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"One capability: evidence, spec, topics, examples, linked work","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["knowledge","data","action"]},"owner":{"type":"string","nullable":true},"status":{"type":"string","enum":["missing","failing","working","policy","not_enough_evidence"]},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"firstSeenAt":{"type":"string","format":"date-time"},"spec":{"type":"object","nullable":true,"properties":{"reads":{"type":"string","nullable":true},"input":{"type":"string","nullable":true},"returns":{"type":"string","nullable":true},"limits":{"type":"string","nullable":true}},"required":["reads","input","returns","limits"]},"todaySummary":{"type":"string","nullable":true},"summaryGeneratedAt":{"type":"string","nullable":true,"format":"date-time"},"metrics":{"type":"object","properties":{"failedPerMonth":{"type":"integer"},"handledPerMonth":{"type":"integer"},"outcomesPerMonth":{"type":"object","properties":{"escalated":{"type":"integer"},"failed":{"type":"integer"},"resolved":{"type":"integer"}},"required":["escalated","failed","resolved"]},"shareOfGaps":{"type":"number"},"largestGap":{"type":"boolean"},"samples":{"type":"integer"},"sampledConversations":{"type":"integer"},"lowConfidence":{"type":"boolean"}},"required":["failedPerMonth","handledPerMonth","outcomesPerMonth","shareOfGaps","largestGap","samples","sampledConversations","lowConfidence"]},"topics":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"perMonth":{"type":"integer"},"share":{"type":"number"}},"required":["name","perMonth","share"]}},"examples":{"type":"array","items":{"type":"object","properties":{"ticket":{"type":"string","nullable":true},"customerAsked":{"type":"string"},"whatHappened":{"type":"string"}},"required":["ticket","customerAsked","whatHappened"]}},"exampleCount":{"type":"integer"},"weekly":{"type":"array","items":{"type":"object","properties":{"week":{"type":"string"},"escalated":{"type":"integer"},"failed":{"type":"integer"}},"required":["week","escalated","failed"]}},"conversations":{"type":"array","items":{"type":"object","properties":{"sampleId":{"type":"string","format":"uuid"},"label":{"type":"string"},"customerAsked":{"type":"string","nullable":true},"topic":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"outcome":{"type":"string","enum":["escalated","failed","resolved"]},"day":{"type":"string","nullable":true},"eventId":{"type":"string","nullable":true,"format":"uuid"}},"required":["sampleId","label","customerAsked","topic","summary","outcome","day","eventId"]}},"markers":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"date":{"type":"string"},"kind":{"type":"string","enum":["release"]}},"required":["label","date","kind"]}},"definition":{"type":"string","nullable":true},"analysis":{"type":"object","nullable":true,"properties":{"paragraphs":{"type":"array","items":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["text","bold","tool","conversation"]},"text":{"type":"string"}},"required":["kind","text"]}}},"sampleCount":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"},"conversations":{"type":"object","additionalProperties":{"type":"object","properties":{"label":{"type":"string"},"eventId":{"type":"string","nullable":true,"format":"uuid"}},"required":["label","eventId"]}},"tools":{"type":"object","additionalProperties":{"type":"object","properties":{"calls":{"type":"integer"},"failed":{"type":"integer"}},"required":["calls","failed"]}}},"required":["paragraphs","sampleCount","from","to","conversations","tools"]},"customerAsks":{"type":"array","items":{"type":"string"}},"agentSteps":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"policy":{"type":"boolean"}},"required":["text","policy"]}},"fixes":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string","enum":["spec","article","instruction"]},"title":{"type":"string"},"goal":{"type":"string"},"body":{"type":"string"},"deploymentAction":{"type":"string","nullable":true,"enum":["create","update"]},"articleTitle":{"type":"string","nullable":true},"articleEdits":{"type":"array","items":{"type":"object","properties":{"before":{"type":"string"},"after":{"type":"string"},"rationale":{"type":"string"}},"required":["before","after","rationale"]}},"before":{"type":"string","nullable":true},"acceptanceCriteria":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"scorer":{"type":"string","nullable":true},"threshold":{"type":"number","nullable":true}},"required":["text","scorer","threshold"]}},"owner":{"type":"string","nullable":true},"destination":{"type":"string","nullable":true},"estimatedMonthlyMoved":{"type":"integer"},"interimNote":{"type":"string","nullable":true},"publishedAt":{"type":"string","nullable":true}},"required":["id","type","title","goal","body","deploymentAction","articleTitle","articleEdits","before","acceptanceCriteria","owner","destination","estimatedMonthlyMoved","interimNote","publishedAt"]}},"datasetId":{"type":"string","nullable":true,"format":"uuid"},"implementations":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["tool","kb_document","instruction"]},"ref":{"type":"string"}},"required":["kind","ref"]}},"links":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"kind":{"type":"string","enum":["linear","jira","release","dataset"]},"externalId":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"title":{"type":"string"},"statusCache":{"type":"string","nullable":true},"botReleaseId":{"type":"string","nullable":true,"format":"uuid"},"datasetId":{"type":"string","nullable":true,"format":"uuid"},"releasedOn":{"type":"string","nullable":true},"linkedBy":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","kind","externalId","url","title","statusCache","botReleaseId","datasetId","releasedOn","linkedBy","createdAt"]}}},"required":["id","name","description","type","owner","status","agent","firstSeenAt","spec","todaySummary","summaryGeneratedAt","metrics","topics","examples","exampleCount","weekly","conversations","markers","definition","analysis","customerAsks","agentSteps","fixes","datasetId","implementations","links"]}},"required":["data"]}}}},"404":{"description":"Capability not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateAgentMonitoringCapability","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"owner":{"type":"string","nullable":true,"maxLength":120}},"required":["owner"]}}}},"responses":{"204":{"description":"Updated"},"404":{"description":"Capability not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/conversations/{sampleId}":{"get":{"operationId":"getAgentMonitoringCapabilityConversation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"sampleId","in":"path"}],"responses":{"200":{"description":"One sampled conversation as a case: ticket, outcome, timeline and rubric review","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"string","nullable":true}},"required":["id","name","version"]},"ticket":{"type":"object","nullable":true,"properties":{"reference":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"helpdesk":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"closedAt":{"type":"string","nullable":true,"format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"customerName":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"contained":{"type":"boolean","nullable":true},"handedOffAt":{"type":"string","nullable":true,"format":"date-time"},"firstHumanReplyAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["reference","url","helpdesk","status","startedAt","closedAt","resolvedAt","customerName","tags","contained","handedOffAt","firstHumanReplyAt"]},"outcome":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["contained","handed_off","timed_out","open"]},"handoffWaitSeconds":{"type":"integer","nullable":true}},"required":["kind","handoffWaitSeconds"]},"closure":{"type":"object","nullable":true,"properties":{"by":{"type":"string","enum":["agent","human","timeout"]},"at":{"type":"string","format":"date-time"}},"required":["by","at"]},"properties":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"string"}},"required":["label","value"]}},"ticketEvents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"occurredAt":{"type":"string","format":"date-time"},"kind":{"type":"string","enum":["field","status","group","tags"]},"label":{"type":"string"},"value":{"type":"string","nullable":true},"previousValue":{"type":"string","nullable":true},"addedTags":{"type":"array","items":{"type":"string"}},"removedTags":{"type":"array","items":{"type":"string"}}},"required":["id","occurredAt","kind","label","value","previousValue","addedTags","removedTags"]}},"handoffReason":{"type":"object","nullable":true,"properties":{"gapType":{"type":"string"},"title":{"type":"string"},"why":{"type":"string"}},"required":["gapType","title","why"]},"parts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"seq":{"type":"integer"},"occurredAt":{"type":"string"},"actor":{"type":"string","enum":["self","customer","human_agent","other_bot","system"]},"kind":{"type":"string","enum":["message","note","tool_call","handoff","assignment","csat"]},"visibility":{"type":"string","enum":["public","internal"]},"authorName":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"contentEnglish":{"type":"string","nullable":true},"data":{"type":"object","additionalProperties":{"nullable":true}},"botEventId":{"type":"string","nullable":true}},"required":["id","seq","occurredAt","actor","kind","visibility","authorName","content","contentEnglish","data","botEventId"]}},"translation":{"type":"object","nullable":true,"properties":{"status":{"type":"string"},"sourceLanguage":{"type":"string","nullable":true}},"required":["status","sourceLanguage"]},"annotations":{"type":"array","items":{"type":"object","properties":{"partId":{"type":"string"},"rubrics":{"type":"array","items":{"type":"string"}},"notes":{"type":"array","items":{"type":"string"}}},"required":["partId","rubrics","notes"]}},"review":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"completedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","title","summary","completedAt"]},"rubric":{"type":"array","items":{"type":"object","properties":{"scorerId":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"value":{"type":"number"},"passed":{"type":"boolean"},"reason":{"type":"string","nullable":true},"partIds":{"type":"array","items":{"type":"string"}}},"required":["scorerId","name","type","value","passed","reason","partIds"]}}},"required":["agent","ticket","outcome","closure","properties","ticketEvents","handoffReason","parts","translation","annotations","review","rubric"]}},"required":["data"]}}}},"404":{"description":"Capability or conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/links":{"post":{"operationId":"linkAgentMonitoringCapabilityWork","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["linear","jira","release","dataset"]},"title":{"type":"string","minLength":1,"maxLength":200},"url":{"type":"string","maxLength":500,"format":"uri"},"externalId":{"type":"string","maxLength":80},"botReleaseId":{"type":"string","format":"uuid"},"datasetId":{"type":"string","format":"uuid"}},"required":["kind"]}}}},"responses":{"201":{"description":"The work was linked","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}},"404":{"description":"Capability or release not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"The link is missing what its kind needs","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/links/{linkId}":{"delete":{"operationId":"unlinkAgentMonitoringCapabilityWork","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"linkId","in":"path"}],"responses":{"204":{"description":"Unlinked"},"404":{"description":"Link not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/fixes/{fixId}/publish":{"post":{"operationId":"publishAgentMonitoringCapabilityFix","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"fixId","in":"path"}],"responses":{"200":{"description":"The article was written to the agent's knowledge source","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"documentId":{"type":"string","format":"uuid"},"providerUrl":{"type":"string","nullable":true}},"required":["documentId","providerUrl"]}},"required":["data"]}}}},"404":{"description":"Fix not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"The fix is already being published or its source article changed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Only unpublished article fixes can be published","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/activity":{"get":{"operationId":"listAgentMonitoringCapabilityActivity","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"What happened on the capability, newest first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["comment","owner_changed","link_added","link_removed","fix_published","found","fix_suggested"]},"actor":{"type":"object","nullable":true,"properties":{"membershipId":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["membershipId","name"]},"createdAt":{"type":"string","format":"date-time"},"body":{"type":"string","nullable":true},"data":{"type":"object","properties":{"owner":{"type":"string","nullable":true},"linkId":{"type":"string"},"linkLabel":{"type":"string"},"linkUrl":{"type":"string"},"fixId":{"type":"string"},"fixTitle":{"type":"string"}}}},"required":["id","kind","actor","createdAt","body","data"]}}},"required":["data"]}}}},"404":{"description":"Capability not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/comments":{"post":{"operationId":"commentOnAgentMonitoringCapability","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"body":{"type":"string","minLength":1,"maxLength":4000}},"required":["body"]}}}},"responses":{"201":{"description":"The comment was added","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","createdAt"]}},"required":["data"]}}}},"404":{"description":"Capability not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/capabilities/{id}/conversations/{sampleId}/translate":{"post":{"operationId":"translateAgentMonitoringCapabilityConversation","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"sampleId","in":"path"}],"responses":{"202":{"description":"An English translation of the case's conversation was requested","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"]}},"required":["data"]}}}},"404":{"description":"Unknown capability or case, or a case without an agent conversation","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/knowledge/documents":{"get":{"operationId":"listAgentMonitoringKnowledgeDocuments","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Bot-owned knowledge documents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["zendesk"]},"externalArticleId":{"type":"string"},"brandId":{"type":"string"},"brandName":{"type":"string","nullable":true},"locale":{"type":"string"},"section":{"type":"string","nullable":true},"title":{"type":"string"},"url":{"type":"string","nullable":true},"remoteUpdatedAt":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string"}},"required":["id","botId","provider","externalArticleId","brandId","brandName","locale","section","title","url","remoteUpdatedAt","lastSyncedAt"]}},"meta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"}},"required":["page","limit","total"]}},"required":["data","meta"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/knowledge/documents/{id}":{"get":{"operationId":"getAgentMonitoringKnowledgeDocument","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Bot-owned knowledge document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"provider":{"type":"string","enum":["zendesk"]},"externalArticleId":{"type":"string"},"brandId":{"type":"string"},"brandName":{"type":"string","nullable":true},"locale":{"type":"string"},"section":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"url":{"type":"string","nullable":true},"remoteUpdatedAt":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string"}},"required":["id","botId","provider","externalArticleId","brandId","brandName","locale","section","title","content","url","remoteUpdatedAt","lastSyncedAt"]}},"required":["data"]}}}},"404":{"description":"Document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/knowledge/sync":{"post":{"operationId":"syncAgentMonitoringKnowledge","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"}},"required":["botId"]}}}},"responses":{"202":{"description":"Knowledge sync queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}},"required":["data"]}}}},"404":{"description":"Bot not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/datasets":{"get":{"operationId":"listAgentMonitoringDatasets","responses":{"200":{"description":"The organization's datasets, most recently updated first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"itemCount":{"type":"integer"},"agents":{"type":"array","items":{"type":"string"}},"updatedBy":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","itemCount","agents","updatedBy","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"operationId":"createAgentMonitoringDataset","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":500,"default":null}},"required":["name"]}}}},"responses":{"201":{"description":"The new dataset","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"}},"required":["id"]}},"required":["data"]}}}}}}},"/agent-monitoring/datasets/{id}":{"get":{"operationId":"getAgentMonitoringDataset","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"asOf","in":"query"}],"responses":{"200":{"description":"A dataset and its items","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"kind":{"type":"string","enum":["turn"]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"title":{"type":"string"},"customerAsked":{"type":"string"},"originalReply":{"type":"string"},"expectedReply":{"type":"string"},"source":{"type":"string","enum":["helpdesk","trace","upload"]},"sourceRunId":{"type":"string","nullable":true,"format":"uuid"},"agentVersion":{"type":"string","nullable":true},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"lastEdited":{"type":"object","nullable":true,"properties":{"by":{"type":"string","nullable":true},"at":{"type":"string","format":"date-time"}},"required":["by","at"]}},"required":["id","title","customerAsked","originalReply","expectedReply","source","sourceRunId","agentVersion","agent","lastEdited"]}}},"required":["id","name","description","kind","createdAt","updatedAt","items"]}},"required":["data"]}}}},"404":{"description":"Dataset not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateAgentMonitoringDataset","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","nullable":true,"maxLength":500}}}}}},"responses":{"204":{"description":"The dataset was updated"},"404":{"description":"Dataset not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAgentMonitoringDataset","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"The dataset and its items were deleted"},"404":{"description":"Dataset not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/dataset-items":{"post":{"operationId":"addAgentMonitoringDatasetItems","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string","format":"uuid"},"partKey":{"type":"string","minLength":1,"maxLength":120},"datasetIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1,"maxItems":20},"expectedReply":{"type":"string","nullable":true,"maxLength":4000,"default":null}},"required":["runId","partKey","datasetIds"]}}}},"responses":{"201":{"description":"The reply was added to the datasets that didn't have it","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"added":{"type":"integer"}},"required":["added"]}},"required":["data"]}}}},"422":{"description":"The part isn't an agent reply that can be added","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/dataset-items/memberships":{"get":{"operationId":"listAgentMonitoringDatasetMemberships","parameters":[{"schema":{"type":"string","minLength":1,"maxLength":120},"required":true,"name":"partKey","in":"query"}],"responses":{"200":{"description":"Datasets that already hold this agent reply","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["data"]}}}}}}},"/agent-monitoring/datasets/{id}/items/{itemId}":{"get":{"operationId":"getAgentMonitoringDatasetItem","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"itemId","in":"path"}],"responses":{"200":{"description":"One dataset item with its input snapshot","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"datasetId":{"type":"string","format":"uuid"},"title":{"type":"string"},"source":{"type":"string","enum":["helpdesk","trace","upload"]},"schemaVersion":{"type":"integer"},"history":{"type":"array","items":{"$ref":"#/components/schemas/DatasetMessage"}},"input":{"type":"array","items":{"$ref":"#/components/schemas/DatasetMessage"}},"systemInstructions":{"type":"string","nullable":true},"output":{"type":"array","items":{"$ref":"#/components/schemas/DatasetMessage"}},"expected":{"type":"array","items":{"$ref":"#/components/schemas/DatasetMessage"}},"originalReply":{"type":"string"},"expectedReply":{"type":"string"},"note":{"type":"string","nullable":true},"sourceRunId":{"type":"string","nullable":true,"format":"uuid"},"agentVersion":{"type":"string","nullable":true},"agent":{"type":"object","nullable":true,"properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"addedAt":{"type":"string","format":"date-time"},"addedBy":{"type":"string","nullable":true},"lastEdited":{"type":"object","nullable":true,"properties":{"by":{"type":"string","nullable":true},"at":{"type":"string","format":"date-time"}},"required":["by","at"]}},"required":["id","datasetId","title","source","schemaVersion","history","input","systemInstructions","output","expected","originalReply","expectedReply","note","sourceRunId","agentVersion","agent","addedAt","addedBy","lastEdited"]}},"required":["data"]}}}},"404":{"description":"Item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateAgentMonitoringDatasetItem","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"itemId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedReply":{"type":"string","minLength":1,"maxLength":4000},"note":{"type":"string","nullable":true,"maxLength":1000}}}}}},"responses":{"204":{"description":"The item was updated"},"404":{"description":"Item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAgentMonitoringDatasetItem","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"itemId","in":"path"}],"responses":{"204":{"description":"The item was removed from the dataset"},"404":{"description":"Item not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/rubrics":{"get":{"operationId":"listAgentMonitoringRubrics","responses":{"200":{"description":"Built-in and custom rubrics for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentMonitoringRubric"}}},"required":["data"]}}}}}},"post":{"operationId":"createAgentMonitoringRubric","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","enum":["binary","scaled"]},"examples":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string","maxLength":120},"value":{"type":"number","minimum":0,"maximum":1},"expectedValue":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string","maxLength":500},"createdAt":{"type":"string","format":"date-time"}},"required":["railsConversationId","label","value","expectedValue","note","createdAt"]},"maxItems":50,"default":[]}},"required":["name","description","type"]}}}},"responses":{"201":{"description":"The new custom rubric","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentMonitoringRubric"}},"required":["data"]}}}}}}},"/agent-monitoring/rubrics/{id}":{"patch":{"operationId":"updateAgentMonitoringRubric","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","enum":["binary","scaled"]},"enabled":{"type":"boolean"},"examples":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string","maxLength":120},"value":{"type":"number","minimum":0,"maximum":1},"expectedValue":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string","maxLength":500},"createdAt":{"type":"string","format":"date-time"}},"required":["railsConversationId","label","value","expectedValue","note","createdAt"]},"maxItems":50}}}}}},"responses":{"200":{"description":"The updated rubric","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/AgentMonitoringRubric"}},"required":["data"]}}}},"404":{"description":"Rubric not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Built-in rubric definitions can't be changed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"operationId":"deleteAgentMonitoringRubric","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"The custom rubric and its scores were deleted"},"404":{"description":"Rubric not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Built-in rubrics can't be deleted","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/rubric-drafts/generate":{"post":{"operationId":"generateAgentMonitoringRubric","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"note":{"type":"string","minLength":1,"maxLength":1000},"name":{"type":"string","nullable":true,"maxLength":80,"default":null},"type":{"type":"string","enum":["binary","scaled"]}},"required":["note","type"]}}}},"responses":{"200":{"description":"A rubric name and definition written from the note","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]}},"required":["data"]}}}}}}},"/agent-monitoring/rubric-drafts/refine":{"post":{"operationId":"refineAgentMonitoringRubric","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","enum":["binary","scaled"]},"examples":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string","maxLength":120},"value":{"type":"number","minimum":0,"maximum":1},"expectedValue":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string","maxLength":500},"createdAt":{"type":"string","format":"date-time"}},"required":["railsConversationId","label","value","expectedValue","note","createdAt"]},"maxItems":50,"default":[]}},"required":["name","description","type"]}}}},"responses":{"200":{"description":"The definition revised to agree with the corrections","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"description":{"type":"string"}},"required":["description"]}},"required":["data"]}}}}}}},"/agent-monitoring/rubric-drafts/test":{"post":{"operationId":"testAgentMonitoringRubric","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"description":{"type":"string","minLength":1,"maxLength":2000},"type":{"type":"string","enum":["binary","scaled"]},"examples":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string","maxLength":120},"value":{"type":"number","minimum":0,"maximum":1},"expectedValue":{"type":"number","minimum":0,"maximum":1},"note":{"type":"string","maxLength":500},"createdAt":{"type":"string","format":"date-time"}},"required":["railsConversationId","label","value","expectedValue","note","createdAt"]},"maxItems":50,"default":[]},"conversation":{"type":"string","nullable":true,"maxLength":120,"default":null}},"required":["name","description","type"]}}}},"responses":{"200":{"description":"The draft scored against one conversation, or recent reviewed ones","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"label":{"type":"string"},"botConversationId":{"type":"string","format":"uuid"},"applies":{"type":"boolean"},"value":{"type":"number","nullable":true},"reason":{"type":"string","nullable":true},"durationMs":{"type":"integer"}},"required":["railsConversationId","label","botConversationId","applies","value","reason","durationMs"]}}},"required":["data"]}}}},"404":{"description":"No agent conversation matches the ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/rubrics/{id}/report":{"get":{"operationId":"getAgentMonitoringRubricReport","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previousFrom","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previousTo","in":"query"}],"responses":{"200":{"description":"Pass rate, trend, and root causes for one rubric","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"rubric":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"source":{"type":"string","enum":["system","custom"]},"enabled":{"type":"boolean"}},"required":["id","name","description","type","source","enabled"]},"metrics":{"type":"object","properties":{"passRate":{"type":"number","nullable":true},"previousPassRate":{"type":"number","nullable":true},"totalRuns":{"type":"integer"},"failingRuns":{"type":"integer"}},"required":["passRate","previousPassRate","totalRuns","failingRuns"]},"trend":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"average":{"type":"number"},"count":{"type":"integer"}},"required":["date","average","count"]}},"releases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botId":{"type":"string","format":"uuid"},"name":{"type":"string"},"releasedOn":{"type":"string"}},"required":["id","botId","name","releasedOn"]}},"analysis":{"type":"object","nullable":true,"properties":{"status":{"type":"string","enum":["pending","completed","failed"]},"generatedAt":{"type":"string","nullable":true,"format":"date-time"},"windowFrom":{"type":"string","nullable":true},"windowTo":{"type":"string","nullable":true},"failingRunCount":{"type":"integer"},"summary":{"type":"array","items":{"type":"string"}},"overallCsat":{"type":"number","nullable":true},"causes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"suggestedFix":{"type":"string","nullable":true},"flow":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"kind":{"type":"string","enum":["step","wait","failure"]}},"required":["label","kind"]}},"runs":{"type":"integer"},"share":{"type":"number"},"perDay":{"type":"number"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"count":{"type":"integer"}},"required":["date","count"]}},"release":{"type":"object","nullable":true,"properties":{"label":{"type":"string"},"releasedOn":{"type":"string"}},"required":["label","releasedOn"]},"perDayBeforeRelease":{"type":"number"},"perDayAfterRelease":{"type":"number"},"newInRelease":{"type":"boolean"},"exampleRunIds":{"type":"array","items":{"type":"string","format":"uuid"}},"csat":{"type":"number","nullable":true},"worstRuns":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string","format":"uuid"},"customerAsked":{"type":"string","nullable":true},"csat":{"type":"number","nullable":true}},"required":["runId","customerAsked","csat"]}}},"required":["key","name","description","suggestedFix","flow","runs","share","perDay","daily","release","perDayBeforeRelease","perDayAfterRelease","newInRelease","exampleRunIds","csat","worstRuns"]}}},"required":["status","generatedAt","windowFrom","windowTo","failingRunCount","summary","overallCsat","causes"]}},"required":["rubric","metrics","trend","releases","analysis"]}},"required":["data"]}}}},"404":{"description":"Rubric not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/rubrics/{id}/analysis":{"post":{"operationId":"refreshAgentMonitoringRubricAnalysis","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"}],"responses":{"202":{"description":"A fresh analysis was queued, or one is already running","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"queued":{"type":"boolean"}},"required":["queued"]}},"required":["data"]}}}}}}},"/agent-monitoring/rubrics/{id}/runs":{"get":{"operationId":"listAgentMonitoringRubricRuns","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","maxLength":40},"required":false,"name":"cause","in":"query"}],"responses":{"200":{"description":"Failing runs for the rubric, optionally for one root cause","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string","format":"uuid"},"value":{"type":"number"},"reason":{"type":"string","nullable":true},"ranAt":{"type":"string","format":"date-time"},"customerAsked":{"type":"string","nullable":true},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"version":{"type":"string","nullable":true}},"required":["id","name","version"]},"causeKey":{"type":"string","nullable":true}},"required":["runId","value","reason","ranAt","customerAsked","agent","causeKey"]}}},"required":["data"]}}}}}}},"/agent-monitoring/rubric-scores":{"get":{"operationId":"getAgentMonitoringRubricScores","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"to","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previousFrom","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":false,"name":"previousTo","in":"query"}],"responses":{"200":{"description":"Pass rate and daily points for each enabled rubric","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"rubric":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"type":{"type":"string","enum":["binary","scaled"]},"systemKey":{"type":"string","nullable":true,"enum":["routing","correctness","grounding","resolution","tool_use","communication","safety"]}},"required":["id","name","type","systemKey"]},"passRate":{"type":"number","nullable":true},"previousPassRate":{"type":"number","nullable":true},"totalRuns":{"type":"integer"},"failingRuns":{"type":"integer"},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"average":{"type":"number"},"count":{"type":"integer"}},"required":["date","average","count"]}}},"required":["rubric","passRate","previousPassRate","totalRuns","failingRuns","daily"]}}},"required":["data"]}}}}}}},"/agent-monitoring/rubric-scores/{id}/tickets":{"get":{"operationId":"listAgentMonitoringRubricScoredTickets","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"from","in":"query"},{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"required":true,"name":"to","in":"query"}],"responses":{"200":{"description":"Scored tickets for one rubric, lowest score first","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"runId":{"type":"string","format":"uuid"},"ticketId":{"type":"string"},"ticketUrl":{"type":"string","nullable":true},"value":{"type":"number"},"passed":{"type":"boolean"},"reason":{"type":"string","nullable":true},"sampledOn":{"type":"string"},"ranAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]}},"required":["runId","ticketId","ticketUrl","value","passed","reason","sampledOn","ranAt","agent"]}}},"required":["data"]}}}}}}},"/agent-monitoring/journeys/paths":{"get":{"operationId":"listAgentMonitoringJourneyPaths","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"topicId","in":"query"},{"schema":{"type":"string","enum":["contained","escalated","unknown"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"startEvent","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"endEvent","in":"query"},{"schema":{"type":"string","enum":["type","detailed"],"default":"type"},"required":false,"name":"stepGranularity","in":"query"},{"schema":{"type":"integer","minimum":2,"maximum":20,"default":8},"required":false,"name":"maxSteps","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":50,"default":6},"required":false,"name":"branchLimit","in":"query"}],"responses":{"200":{"description":"Aggregated agent journey paths","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"availability":{"type":"string","enum":["available","unavailable"]},"unavailableReason":{"type":"string","nullable":true,"enum":["clickhouse_not_configured","query_failed"]},"range":{"type":"object","properties":{"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"}},"required":["from","to"]},"summary":{"type":"object","properties":{"conversationCount":{"type":"integer","minimum":0},"containedCount":{"type":"integer","minimum":0},"escalatedCount":{"type":"integer","minimum":0},"unknownOutcomeCount":{"type":"integer","minimum":0},"containmentRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"medianDurationMs":{"type":"number","nullable":true,"minimum":0},"truncatedConversationCount":{"type":"integer","minimum":0}},"required":["conversationCount","containedCount","escalatedCount","unknownOutcomeCount","containmentRate","medianDurationMs","truncatedConversationCount"]},"eventOptions":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"},"conversationCount":{"type":"integer","minimum":0}},"required":["key","name","label","category","conversationCount"]}},"nodes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"},"conversationCount":{"type":"integer","minimum":0},"conversationShare":{"type":"number","minimum":0,"maximum":1},"containedCount":{"type":"integer","minimum":0},"escalatedCount":{"type":"integer","minimum":0},"containmentRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"exampleConversationIds":{"type":"array","items":{"type":"string","format":"uuid"}},"id":{"type":"string"},"step":{"type":"integer","minimum":0},"isOther":{"type":"boolean"},"stepConversationShare":{"type":"number","minimum":0,"maximum":1},"exampleConversations":{"type":"array","items":{"type":"object","properties":{"botConversationId":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true}},"required":["botConversationId","conversationId"]}}},"required":["key","name","label","category","conversationCount","conversationShare","containedCount","escalatedCount","containmentRate","exampleConversationIds","id","step","isOther","stepConversationShare","exampleConversations"]}},"edges":{"type":"array","items":{"type":"object","properties":{"conversationCount":{"type":"integer","minimum":0},"conversationShare":{"type":"number","minimum":0,"maximum":1},"containedCount":{"type":"integer","minimum":0},"escalatedCount":{"type":"integer","minimum":0},"containmentRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"exampleConversationIds":{"type":"array","items":{"type":"string","format":"uuid"}},"id":{"type":"string"},"sourceNodeId":{"type":"string"},"targetNodeId":{"type":"string"},"sourceStep":{"type":"integer","minimum":0},"targetStep":{"type":"integer","minimum":0},"transitionShare":{"type":"number","minimum":0,"maximum":1},"source":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"}},"required":["key","name","label","category"]},"target":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"category":{"type":"string"}},"required":["key","name","label","category"]}},"required":["conversationCount","conversationShare","containedCount","escalatedCount","containmentRate","exampleConversationIds","id","sourceNodeId","targetNodeId","sourceStep","targetStep","transitionShare","source","target"]}}},"required":["availability","unavailableReason","range","summary","eventOptions","nodes","edges"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/journeys/node-conversations":{"get":{"operationId":"listAgentMonitoringJourneyNodeConversations","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"botId","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"topicId","in":"query"},{"schema":{"type":"string","enum":["contained","escalated","unknown"]},"required":false,"name":"outcome","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"startEvent","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":false,"name":"endEvent","in":"query"},{"schema":{"type":"string","enum":["type","detailed"],"default":"type"},"required":false,"name":"stepGranularity","in":"query"},{"schema":{"type":"integer","minimum":2,"maximum":20,"default":8},"required":false,"name":"maxSteps","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":19},"required":false,"name":"step","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":500},"required":true,"name":"eventKey","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"maximum":10000,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Conversations that passed through one journey node","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"availability":{"type":"string","enum":["available","unavailable"]},"total":{"type":"integer","minimum":0},"conversations":{"type":"array","items":{"type":"object","properties":{"botConversationId":{"type":"string","format":"uuid"},"conversationId":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"outcome":{"type":"string","enum":["contained","escalated","unknown"]},"stepLabel":{"type":"string"},"durationMs":{"type":"number","nullable":true,"minimum":0},"preview":{"type":"string","nullable":true}},"required":["botConversationId","conversationId","startedAt","outcome","stepLabel","durationMs","preview"]}}},"required":["availability","total","conversations"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/journeys/node-summaries":{"post":{"operationId":"summarizeAgentMonitoringJourneyNodes","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"filters":{"type":"object","properties":{"botId":{"type":"string","format":"uuid"},"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"},"topicId":{"type":"string","format":"uuid"},"outcome":{"type":"string","enum":["contained","escalated","unknown"]},"startEvent":{"type":"string","minLength":1,"maxLength":500},"endEvent":{"type":"string","minLength":1,"maxLength":500},"stepGranularity":{"type":"string","enum":["type","detailed"],"default":"type"},"maxSteps":{"type":"integer","minimum":2,"maximum":20,"default":8}}},"nodes":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":0,"maximum":19},"key":{"type":"string","minLength":1,"maxLength":500},"label":{"type":"string","maxLength":200}},"required":["step","key","label"]},"minItems":1,"maxItems":60}},"required":["filters","nodes"]}}}},"responses":{"200":{"description":"Generated summaries for the nodes that could be summarized","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"summaries":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":0},"key":{"type":"string"},"headline":{"type":"string"},"description":{"type":"string","nullable":true}},"required":["step","key","headline","description"]}}},"required":["summaries"]}},"required":["data"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors":{"get":{"operationId":"listBotMonitors","responses":{"200":{"description":"Natural-language Agent Monitoring monitors","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"status":{"type":"string","enum":["active","paused"]},"classifierVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluatedEventCount":{"type":"integer","minimum":0},"eligibleEventCount":{"type":"integer","minimum":0},"matchedEventCount":{"type":"integer","minimum":0},"matchRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"instanceTrend":{"type":"array","items":{"type":"integer","minimum":0}},"lastMatchedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["id","name","description","polarity","eligibility","botIds","status","classifierVersion","evaluatedEventCount","eligibleEventCount","matchedEventCount","matchRate","instanceTrend","lastMatchedAt","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"operationId":"createBotMonitor","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":2000},"polarity":{"type":"string","enum":["positive","negative"],"default":"negative"},"eligibility":{"type":"string","minLength":10,"maxLength":1000,"default":"The target event contains enough evidence to judge the monitored behavior."},"botIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"deterministicPlan":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0.95,"maximum":1},"all":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["target_input","target_output","conversation","tool_name","tool_error","helpdesk_tag","helpdesk_brand","helpdesk_field","origin"]},"operator":{"type":"string","enum":["contains_any","contains_all","equals_any"]},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"minItems":1,"maxItems":12}},"required":["source","operator","values"]},"minItems":1,"maxItems":8}},"required":["id","confidence","all"]},"maxItems":12}},"default":{"version":1,"rules":[]},"required":["version","rules"]}},"required":["name","description"]}}}},"responses":{"201":{"description":"Monitor created and recent event evaluation queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"status":{"type":"string","enum":["active","paused"]},"classifierVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluatedEventCount":{"type":"integer","minimum":0},"eligibleEventCount":{"type":"integer","minimum":0},"matchedEventCount":{"type":"integer","minimum":0},"matchRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"instanceTrend":{"type":"array","items":{"type":"integer","minimum":0}},"lastMatchedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recentEvents":{"type":"array","items":{"type":"object","properties":{"evaluationId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evaluatedAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"prefixId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","railsConversationId","prefixId","subject"]}},"required":["evaluationId","eventId","botConversationId","origin","inputMessages","outputMessages","startedAt","endedAt","confidence","reason","evaluatedAt","agent","conversation"]}}},"required":["id","name","description","polarity","eligibility","botIds","status","classifierVersion","evaluatedEventCount","eligibleEventCount","matchedEventCount","matchRate","instanceTrend","lastMatchedAt","createdAt","updatedAt","recentEvents"]}},"required":["data"]}}}},"400":{"description":"Invalid monitor scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors/draft":{"post":{"operationId":"draftBotMonitor","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"prompt":{"type":"string","minLength":10,"maxLength":2000},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["prompt"]}}}},"responses":{"200":{"description":"A short title and classifier description drafted from the user's request","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"deterministicPlan":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0.95,"maximum":1},"all":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["target_input","target_output","conversation","tool_name","tool_error","helpdesk_tag","helpdesk_brand","helpdesk_field","origin"]},"operator":{"type":"string","enum":["contains_any","contains_all","equals_any"]},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"minItems":1,"maxItems":12}},"required":["source","operator","values"]},"minItems":1,"maxItems":8}},"required":["id","confidence","all"]},"maxItems":12}},"required":["version","rules"]}},"required":["name","description","polarity","eligibility","deterministicPlan"]}},"required":["data"]}}}}}}},"/agent-monitoring/monitors/{monitorId}":{"get":{"operationId":"getBotMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"}],"responses":{"200":{"description":"Monitor definition and recent matching events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"status":{"type":"string","enum":["active","paused"]},"classifierVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluatedEventCount":{"type":"integer","minimum":0},"eligibleEventCount":{"type":"integer","minimum":0},"matchedEventCount":{"type":"integer","minimum":0},"matchRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"instanceTrend":{"type":"array","items":{"type":"integer","minimum":0}},"lastMatchedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recentEvents":{"type":"array","items":{"type":"object","properties":{"evaluationId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evaluatedAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"prefixId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","railsConversationId","prefixId","subject"]}},"required":["evaluationId","eventId","botConversationId","origin","inputMessages","outputMessages","startedAt","endedAt","confidence","reason","evaluatedAt","agent","conversation"]}}},"required":["id","name","description","polarity","eligibility","botIds","status","classifierVersion","evaluatedEventCount","eligibleEventCount","matchedEventCount","matchRate","instanceTrend","lastMatchedAt","createdAt","updatedAt","recentEvents"]}},"required":["data"]}}}},"404":{"description":"Monitor not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"operationId":"updateBotMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"description":{"type":"string","minLength":10,"maxLength":2000},"polarity":{"type":"string","enum":["positive","negative"],"default":"negative"},"eligibility":{"type":"string","minLength":10,"maxLength":1000,"default":"The target event contains enough evidence to judge the monitored behavior."},"botIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"deterministicPlan":{"type":"object","properties":{"version":{"type":"number","enum":[1]},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":80},"confidence":{"type":"number","minimum":0.95,"maximum":1},"all":{"type":"array","items":{"type":"object","properties":{"source":{"type":"string","enum":["target_input","target_output","conversation","tool_name","tool_error","helpdesk_tag","helpdesk_brand","helpdesk_field","origin"]},"operator":{"type":"string","enum":["contains_any","contains_all","equals_any"]},"values":{"type":"array","items":{"type":"string","minLength":1,"maxLength":160},"minItems":1,"maxItems":12}},"required":["source","operator","values"]},"minItems":1,"maxItems":8}},"required":["id","confidence","all"]},"maxItems":12}},"default":{"version":1,"rules":[]},"required":["version","rules"]},"status":{"type":"string","enum":["active","paused"]}}}}}},"responses":{"200":{"description":"Updated monitor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"status":{"type":"string","enum":["active","paused"]},"classifierVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluatedEventCount":{"type":"integer","minimum":0},"eligibleEventCount":{"type":"integer","minimum":0},"matchedEventCount":{"type":"integer","minimum":0},"matchRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"instanceTrend":{"type":"array","items":{"type":"integer","minimum":0}},"lastMatchedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recentEvents":{"type":"array","items":{"type":"object","properties":{"evaluationId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evaluatedAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"prefixId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","railsConversationId","prefixId","subject"]}},"required":["evaluationId","eventId","botConversationId","origin","inputMessages","outputMessages","startedAt","endedAt","confidence","reason","evaluatedAt","agent","conversation"]}}},"required":["id","name","description","polarity","eligibility","botIds","status","classifierVersion","evaluatedEventCount","eligibleEventCount","matchedEventCount","matchRate","instanceTrend","lastMatchedAt","createdAt","updatedAt","recentEvents"]}},"required":["data"]}}}},"400":{"description":"Invalid monitor scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Monitor not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors/{monitorId}/events":{"get":{"operationId":"listBotMonitorEvents","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0,"default":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Paginated matching events for a monitor","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"evaluationId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evaluatedAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"prefixId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","railsConversationId","prefixId","subject"]}},"required":["evaluationId","eventId","botConversationId","origin","inputMessages","outputMessages","startedAt","endedAt","confidence","reason","evaluatedAt","agent","conversation"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"integer","nullable":true,"minimum":0},"limit":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["next","limit"]}},"required":["page"]}},"required":["data","meta"]}}}},"404":{"description":"Monitor not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors/{monitorId}/quality":{"get":{"operationId":"getBotMonitorQuality","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"}],"responses":{"200":{"description":"Precision and recall measured from human-labeled events","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"evaluatedEventCount":{"type":"integer","minimum":0},"predictedMatchedEventCount":{"type":"integer","minimum":0},"labeledEventCount":{"type":"integer","minimum":0},"truePositiveCount":{"type":"integer","minimum":0},"falsePositiveCount":{"type":"integer","minimum":0},"falseNegativeCount":{"type":"integer","minimum":0},"trueNegativeCount":{"type":"integer","minimum":0},"precision":{"type":"number","nullable":true,"minimum":0,"maximum":1},"recall":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["evaluatedEventCount","predictedMatchedEventCount","labeledEventCount","truePositiveCount","falsePositiveCount","falseNegativeCount","trueNegativeCount","precision","recall"]}},"required":["data"]}}}},"404":{"description":"Monitor not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors/{monitorId}/validation-sample":{"get":{"operationId":"listBotMonitorValidationSample","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":5,"default":5},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"A balanced sample of predicted matches and non-matches for human review","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"eventId":{"type":"string","format":"uuid"},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"predictedMatched":{"type":"boolean"},"decisionPath":{"type":"string","enum":["deterministic_inapplicable","deterministic_match","semantic"]},"confidence":{"type":"number","minimum":0,"maximum":1},"expectedMatched":{"type":"boolean","nullable":true}},"required":["eventId","inputMessages","outputMessages","startedAt","predictedMatched","decisionPath","confidence","expectedMatched"]},"maxItems":5}},"required":["data"]}}}},"404":{"description":"Monitor not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitors/{monitorId}/events/{eventId}/label":{"put":{"operationId":"labelBotMonitorEvent","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"monitorId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"eventId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"expectedMatched":{"type":"boolean"},"note":{"type":"string","nullable":true,"maxLength":1000}},"required":["expectedMatched"]}}}},"responses":{"200":{"description":"Saved human label and updated classifier quality","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"evaluatedEventCount":{"type":"integer","minimum":0},"predictedMatchedEventCount":{"type":"integer","minimum":0},"labeledEventCount":{"type":"integer","minimum":0},"truePositiveCount":{"type":"integer","minimum":0},"falsePositiveCount":{"type":"integer","minimum":0},"falseNegativeCount":{"type":"integer","minimum":0},"trueNegativeCount":{"type":"integer","minimum":0},"precision":{"type":"number","nullable":true,"minimum":0,"maximum":1},"recall":{"type":"number","nullable":true,"minimum":0,"maximum":1}},"required":["evaluatedEventCount","predictedMatchedEventCount","labeledEventCount","truePositiveCount","falsePositiveCount","falseNegativeCount","trueNegativeCount","precision","recall"]}},"required":["data"]}}}},"404":{"description":"Monitor evaluation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitor-suggestions":{"get":{"operationId":"listBotMonitorSuggestions","responses":{"200":{"description":"Evidence-backed monitor suggestions awaiting review","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"rationale":{"type":"string"},"category":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"frequencyScore":{"type":"number","minimum":0,"maximum":1},"impactScore":{"type":"number","minimum":0,"maximum":1},"confidenceScore":{"type":"number","minimum":0,"maximum":1},"actionabilityScore":{"type":"number","minimum":0,"maximum":1},"noveltyScore":{"type":"number","minimum":0,"maximum":1},"rankScore":{"type":"number","minimum":0,"maximum":1},"validationSampleSize":{"type":"integer","minimum":0},"validationMatchedEventCount":{"type":"integer","minimum":0},"windowStartedAt":{"type":"string","format":"date-time"},"windowEndedAt":{"type":"string","format":"date-time"},"generatedAt":{"type":"string","format":"date-time"},"evidence":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"botEventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"impactScore":{"type":"number","minimum":0,"maximum":1},"summary":{"type":"object","properties":{"targetEvent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"startedAt":{"type":"string","format":"date-time"},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}}},"required":["id","startedAt","inputMessages","outputMessages"]},"conversation":{"type":"object","properties":{"messageCount":{"type":"integer","minimum":0},"traceCount":{"type":"integer","minimum":0},"toolCallCount":{"type":"integer","minimum":0},"toolFailureCount":{"type":"integer","minimum":0},"scoreCount":{"type":"integer","minimum":0}},"required":["messageCount","traceCount","toolCallCount","toolFailureCount","scoreCount"]},"businessOutcomes":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["targetEvent","conversation","businessOutcomes"]}},"required":["id","botEventId","botConversationId","confidence","reason","impactScore","summary"]}}},"required":["id","name","description","rationale","category","botIds","frequencyScore","impactScore","confidenceScore","actionabilityScore","noveltyScore","rankScore","validationSampleSize","validationMatchedEventCount","windowStartedAt","windowEndedAt","generatedAt","evidence"]}}},"required":["data"]}}}}}}},"/agent-monitoring/monitor-suggestions/{suggestionId}/accept":{"post":{"operationId":"acceptBotMonitorSuggestion","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"suggestionId","in":"path"}],"responses":{"201":{"description":"Suggestion accepted as a live monitor and backfill queued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":"string"},"polarity":{"type":"string","enum":["positive","negative"]},"eligibility":{"type":"string"},"botIds":{"type":"array","items":{"type":"string","format":"uuid"}},"status":{"type":"string","enum":["active","paused"]},"classifierVersion":{"type":"integer","minimum":0,"exclusiveMinimum":true},"evaluatedEventCount":{"type":"integer","minimum":0},"eligibleEventCount":{"type":"integer","minimum":0},"matchedEventCount":{"type":"integer","minimum":0},"matchRate":{"type":"number","nullable":true,"minimum":0,"maximum":1},"instanceTrend":{"type":"array","items":{"type":"integer","minimum":0}},"lastMatchedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"},"recentEvents":{"type":"array","items":{"type":"object","properties":{"evaluationId":{"type":"string","format":"uuid"},"eventId":{"type":"string","format":"uuid"},"botConversationId":{"type":"string","format":"uuid"},"origin":{"type":"string","enum":["explicit","otel_projection","helpdesk_projection"]},"inputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"outputMessages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["customer","assistant"]},"content":{"type":"string"},"occurredAt":{"type":"string","nullable":true},"source":{"type":"string","enum":["helpdesk","trace","explicit"]},"sourceId":{"type":"string","nullable":true}},"required":["role","content","occurredAt","source","sourceId"]}},"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","nullable":true,"format":"date-time"},"confidence":{"type":"number","minimum":0,"maximum":1},"reason":{"type":"string","nullable":true},"evaluatedAt":{"type":"string","format":"date-time"},"agent":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"}},"required":["id","name"]},"conversation":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"railsConversationId":{"type":"integer","nullable":true},"prefixId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true}},"required":["id","railsConversationId","prefixId","subject"]}},"required":["evaluationId","eventId","botConversationId","origin","inputMessages","outputMessages","startedAt","endedAt","confidence","reason","evaluatedAt","agent","conversation"]}}},"required":["id","name","description","polarity","eligibility","botIds","status","classifierVersion","evaluatedEventCount","eligibleEventCount","matchedEventCount","matchRate","instanceTrend","lastMatchedAt","createdAt","updatedAt","recentEvents"]}},"required":["data"]}}}},"400":{"description":"Suggested agent scope is no longer valid","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Pending suggestion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/agent-monitoring/monitor-suggestions/{suggestionId}":{"delete":{"operationId":"dismissBotMonitorSuggestion","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"suggestionId","in":"path"}],"responses":{"204":{"description":"Suggestion dismissed"},"404":{"description":"Pending suggestion not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes":{"get":{"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List outcomes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":4000},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string","minLength":1},"values":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["title","description","targetDate"]}}}},"responses":{"201":{"description":"Outcome created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Outcome detail","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","minLength":1,"maxLength":4000},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string","minLength":1},"values":{"type":"array","items":{"type":"string","minLength":1},"minItems":1}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}}}}},"responses":{"200":{"description":"Outcome updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Version conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Outcome deleted"},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/sample":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Sample evaluations for review","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"evaluations":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"conversationId":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"intent":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true},"closedAt":{"type":"string","nullable":true},"value":{"type":"string","enum":["match","no_match","not_applicable"]},"reason":{"type":"string"},"version":{"type":"integer"},"model":{"type":"string"},"evaluatedAt":{"type":"string"},"labelValue":{"type":"string","nullable":true,"enum":["match","no_match","not_applicable"]},"clusterId":{"type":"string","nullable":true,"format":"uuid"},"rootCauseSummary":{"type":"string","nullable":true},"traceId":{"type":"string"},"stepCount":{"type":"integer","nullable":true,"minimum":0},"brokenCount":{"type":"integer","nullable":true,"minimum":0},"gapCount":{"type":"integer","nullable":true,"minimum":0}},"required":["railsConversationId","conversationId","externalId","subject","summary","customerName","intent","startedAt","closedAt","value","reason","version","model","evaluatedAt","labelValue","clusterId","rootCauseSummary","traceId","stepCount","brokenCount","gapCount"]}}},"required":["status","sampleSize","sampleProgress","agreementRate","evaluations"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/labels":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"value":{"type":"string","enum":["match","no_match","not_applicable"]}},"required":["railsConversationId","value"]}}}},"responses":{"200":{"description":"Label upserted and agreement refreshed","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"agreementRate":{"type":"number","nullable":true},"labelledCount":{"type":"integer"},"comparedCount":{"type":"integer"},"agreedCount":{"type":"integer"}},"required":["agreementRate","labelledCount","comparedCount","agreedCount"]}},"required":["data"]}}}},"400":{"description":"Conversation not in sample","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/recheck":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Sample re-evaluation enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Version conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/confirm":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]}}}}}},"responses":{"200":{"description":"Outcome confirmed; ongoing scoring starts for new conversations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"version":{"type":"integer"},"status":{"type":"string","enum":["draft","sampling","reviewing","active","archived"]},"sampleSize":{"type":"integer"},"sampleWindowDays":{"type":"integer"},"sampleAttributes":{"type":"object","properties":{"statuses":{"type":"array","items":{"type":"string","enum":["open","resolved"]}},"channels":{"type":"array","items":{"type":"string","enum":["chat","email","call"]}},"participation":{"type":"array","items":{"type":"string","enum":["bot_only","escalated_to_human"]}},"conversationFieldValueFilters":{"type":"array","items":{"type":"object","properties":{"conversationFieldId":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["conversationFieldId","values"]}}}},"metricTargets":{"type":"array","items":{"type":"object","properties":{"metricId":{"type":"string","enum":["containment","rcsat","qa_score","customer_sentiment"]},"comparison":{"type":"string","enum":["gte","lte"]},"value":{"type":"number"}},"required":["metricId","comparison","value"]}},"targetDate":{"type":"string"},"sampleProgress":{"type":"integer"},"agreementRate":{"type":"number","nullable":true},"agreementCheckedAt":{"type":"string","nullable":true},"agreementModel":{"type":"string","nullable":true},"analysisStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"analysisParagraphs":{"type":"array","items":{"type":"string"}},"analysisGeneratedAt":{"type":"string","nullable":true},"analysisModel":{"type":"string","nullable":true},"analysisVersion":{"type":"integer","nullable":true},"clustersStatus":{"type":"string","nullable":true,"enum":["pending","ready","failed"]},"clustersProgress":{"type":"integer"},"clustersGeneratedAt":{"type":"string","nullable":true},"clustersModel":{"type":"string","nullable":true},"clustersVersion":{"type":"integer","nullable":true},"confirmedAt":{"type":"string","nullable":true},"rate":{"type":"number","nullable":true},"matchCount":{"type":"integer"},"noMatchCount":{"type":"integer"},"notApplicableCount":{"type":"integer"},"evaluatedCount":{"type":"integer"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","description","direction","version","status","sampleSize","sampleWindowDays","sampleAttributes","metricTargets","targetDate","sampleProgress","agreementRate","agreementCheckedAt","agreementModel","analysisStatus","analysisParagraphs","analysisGeneratedAt","analysisModel","analysisVersion","clustersStatus","clustersProgress","clustersGeneratedAt","clustersModel","clustersVersion","confirmedAt","rate","matchCount","noMatchCount","notApplicableCount","evaluatedCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Not ready","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/evaluations":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["match","no_match","not_applicable"]},"required":false,"name":"value","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":200},"required":false,"name":"limit","in":"query"},{"schema":{"type":"integer","nullable":true,"minimum":0},"required":false,"name":"offset","in":"query"}],"responses":{"200":{"description":"Evaluations for an outcome version","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"conversationId":{"type":"string","nullable":true},"externalId":{"type":"string","nullable":true},"subject":{"type":"string","nullable":true},"summary":{"type":"string","nullable":true},"customerName":{"type":"string","nullable":true},"intent":{"type":"string","nullable":true},"startedAt":{"type":"string","nullable":true},"closedAt":{"type":"string","nullable":true},"value":{"type":"string","enum":["match","no_match","not_applicable"]},"reason":{"type":"string"},"version":{"type":"integer"},"model":{"type":"string"},"evaluatedAt":{"type":"string"},"labelValue":{"type":"string","nullable":true,"enum":["match","no_match","not_applicable"]},"clusterId":{"type":"string","nullable":true,"format":"uuid"},"rootCauseSummary":{"type":"string","nullable":true},"traceId":{"type":"string"},"stepCount":{"type":"integer","nullable":true,"minimum":0},"brokenCount":{"type":"integer","nullable":true,"minimum":0},"gapCount":{"type":"integer","nullable":true,"minimum":0}},"required":["railsConversationId","conversationId","externalId","subject","summary","customerName","intent","startedAt","closedAt","value","reason","version","model","evaluatedAt","labelValue","clusterId","rootCauseSummary","traceId","stepCount","brokenCount","gapCount"]}},"meta":{"type":"object","properties":{"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}},"required":["total","limit","offset"]}},"required":["data","meta"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/rate-series":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Outcome volume over time by conversation closed_at. handled = match; onTopic = match + no_match.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"match":{"type":"integer"},"noMatch":{"type":"integer"},"notApplicable":{"type":"integer"},"handled":{"type":"integer"},"onTopic":{"type":"integer"},"rate":{"type":"number","nullable":true}},"required":["day","match","noMatch","notApplicable","handled","onTopic","rate"]}},"meta":{"type":"object","properties":{"direction":{"type":"string","enum":["higher_is_better","lower_is_better","none"]},"overallRate":{"type":"number","nullable":true},"handled":{"type":"integer"},"onTopic":{"type":"integer"},"from":{"type":"string"},"to":{"type":"string"}},"required":["direction","overallRate","handled","onTopic","from","to"]}},"required":["data","meta"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/baseline":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"Current baseline metrics for an outcome over conversations.closed_at ([from, to)), with an equal-length previous period.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"conversations":{"type":"object","properties":{"value":{"type":"integer"},"previousValue":{"type":"integer"},"change":{"type":"number","nullable":true}},"required":["value","previousValue","change"]},"rcsat":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previousValue":{"type":"number","nullable":true},"change":{"type":"number","nullable":true}},"required":["value","previousValue","change"]},"deflection":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previousValue":{"type":"number","nullable":true},"change":{"type":"number","nullable":true}},"required":["value","previousValue","change"]},"customerSentiment":{"type":"object","properties":{"value":{"type":"number","nullable":true},"previousValue":{"type":"number","nullable":true},"change":{"type":"number","nullable":true}},"required":["value","previousValue","change"]}},"required":["conversations","rcsat","deflection","customerSentiment"]},"meta":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"previousFrom":{"type":"string"},"previousTo":{"type":"string"},"onTopic":{"type":"integer"},"handled":{"type":"integer"}},"required":["from","to","previousFrom","previousTo","onTopic","handled"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid date range","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/improvements":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":8},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Recommended improvements projected from outcome clusters, capped at 8.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"clusterId":{"type":"string","format":"uuid"},"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["Knowledge base","Tool / capability","Guardrails"]},"conversationCount":{"type":"integer","minimum":0},"sampleSize":{"type":"integer","minimum":0},"failureRate":{"type":"number","minimum":0,"maximum":1},"evidenceConversationIds":{"type":"array","items":{"type":"integer"}},"issueSummary":{"type":"string"},"fixLine":{"type":"string"},"requiredSteps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["evidence","fix"]},"title":{"type":"string"},"description":{"type":"string"}},"required":["kind","title","description"]}},"ticketsDeflected":{"type":"integer"},"projectedOutcome":{"type":"string"},"action":{"type":"string","enum":["Draft doc","Update doc","Suggestion"]},"draftTitle":{"type":"string"},"draftContent":{"type":"string"},"targetRailsDocumentId":{"type":"string","nullable":true},"targetRailsDocumentTitle":{"type":"string","nullable":true},"missRationale":{"type":"string","nullable":true},"source":{"type":"string","enum":["generated"]}},"required":["id","clusterId","title","description","type","conversationCount","sampleSize","failureRate","evidenceConversationIds","fixLine","requiredSteps","ticketsDeflected","projectedOutcome","action","draftTitle","draftContent","source"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/outcomes/{id}/clusters":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":8},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"No_match clusters for the right-pane Clusters tab. Each row pairs with a recommended improvement.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"rank":{"type":"integer"},"clusterTitle":{"type":"string"},"type":{"type":"string","enum":["Knowledge base","Tool / capability","Guardrails"]},"conversationCount":{"type":"integer"},"sampleSize":{"type":"integer","minimum":0},"failureRate":{"type":"number","minimum":0,"maximum":1},"evidenceConversationIds":{"type":"array","items":{"type":"integer"}},"evidence":{"type":"array","items":{"type":"object","properties":{"railsConversationId":{"type":"integer"},"rootCauseSummary":{"type":"string"},"evaluationReason":{"type":"string"}},"required":["railsConversationId","rootCauseSummary","evaluationReason"]}},"issueSummary":{"type":"string"},"featuredConversationId":{"type":"integer","nullable":true},"trace":{"type":"object","nullable":true,"properties":{"conversationId":{"type":"string","minLength":1},"railsConversationId":{"type":"integer"},"stepCount":{"type":"integer","minimum":0},"gapCount":{"type":"integer","minimum":0},"brokenCount":{"type":"integer","minimum":0},"steps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["customer_message","bot_message","agent_message","action","handoff","gap","broken"]},"label":{"type":"string","minLength":1,"maxLength":40},"content":{"type":"string","minLength":1,"maxLength":1200},"at":{"type":"string","nullable":true},"durationMs":{"type":"integer","nullable":true,"minimum":0}},"required":["kind","label","content","at","durationMs"]},"maxItems":60}},"required":["conversationId","railsConversationId","stepCount","gapCount","brokenCount","steps"]},"traceSteps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["customer","agent","system","gap","broken","handoff"]},"content":{"type":"string","minLength":1,"maxLength":1200},"label":{"type":"string","minLength":2,"maxLength":40}},"required":["kind","content"]}},"requiredSteps":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["evidence","fix"]},"title":{"type":"string"},"description":{"type":"string"}},"required":["kind","title","description"]}},"fixLine":{"type":"string"},"improvementTitle":{"type":"string"},"improvementDescription":{"type":"string"},"ticketsDeflected":{"type":"integer"},"projectedOutcome":{"type":"string"},"action":{"type":"string","enum":["Draft doc","Update doc","Suggestion"]},"draftTitle":{"type":"string"},"draftContent":{"type":"string"},"targetRailsDocumentId":{"type":"string","nullable":true},"targetRailsDocumentTitle":{"type":"string","nullable":true},"missRationale":{"type":"string","nullable":true}},"required":["id","rank","clusterTitle","type","conversationCount","evidenceConversationIds","fixLine","improvementTitle","improvementDescription","ticketsDeflected","projectedOutcome","action","draftTitle","draftContent"]}}},"required":["data"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization-products":{"get":{"responses":{"200":{"description":"List active organization products","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}},"responses":{"201":{"description":"Organization product created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","createdAt","updatedAt"]}},"required":["data"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"An active product with this name already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/organization-products/{id}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255}},"required":["name"]}}}},"responses":{"200":{"description":"Organization product updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","createdAt","updatedAt"]}},"required":["data"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization product not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"An active product with this name already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Organization product deleted"},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Organization product not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-complaint-categories/description/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"priority":{"type":"string","enum":["low","medium","high"]},"currentDescription":{"type":"string","nullable":true,"maxLength":10000},"prompt":{"type":"string","minLength":1,"maxLength":4000}},"required":["name","priority","prompt"]}}}},"responses":{"200":{"description":"Generated complaint type description","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"description":{"type":"string","minLength":1,"description":"Complete classifier-ready complaint type description with inclusion and exclusion criteria."}},"required":["description"],"additionalProperties":false}},"required":["data"]}}}},"400":{"description":"Invalid generation input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Description generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/zendesk_brands":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"organization_data_source_id","in":"query"},{"schema":{"type":"string","enum":["active","inactive"]},"required":false,"name":"tracking_status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Zendesk brands for the current organization, by name","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ZendeskBrand"}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/zendesk_brands/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A Zendesk brand","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/ZendeskBrand"}},"required":["data"]}}}},"404":{"description":"Zendesk brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_alerts":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Organization compliance alerts","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"disposition":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"alert_type":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","status","disposition","disposition_notes","assigned_to","dispositioned_at","dispositioned_by","alert_type","provider_created_at","source","raw_data","external_url","synced_at","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_alerts/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance alert","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"disposition":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"alert_type":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"connection":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"compliance_events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"event_type":{"type":"string"},"author":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"disposition":{"type":"string","nullable":true},"reassigned_to":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","external_id","event_type","author","content","status","disposition","reassigned_to","provider_created_at","created_at"]}},"compliance_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","raw_data","external_url","created_at","updated_at"]}},"compliance_cases":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"disposition":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","disposition","external_id","title","description","source","disposition_notes","dispositioned_at","dispositioned_by","assigned_to","provider_created_at","raw_data","external_url","synced_at","created_at","updated_at"]}}},"required":["id","external_id","title","description","status","disposition","disposition_notes","assigned_to","dispositioned_at","dispositioned_by","alert_type","provider_created_at","source","raw_data","external_url","synced_at","created_at","updated_at","connection","compliance_events","compliance_rules","compliance_cases"]}},"required":["data"]}}}},"404":{"description":"Compliance alert not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_cases":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Organization compliance cases","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"disposition":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","status","disposition","external_id","title","description","source","disposition_notes","dispositioned_at","dispositioned_by","assigned_to","provider_created_at","raw_data","external_url","synced_at","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_cases/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance case","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"},"disposition":{"type":"string","nullable":true},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"connection":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"last_synced_at":{"type":"string","nullable":true},"reason_for_request_conversation_field":{"type":"string","nullable":true},"import_conversations_enabled":{"type":"boolean"},"data_source":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true,"enum":["customer_interaction","notification","issue_tracking","knowledge_base","data_warehouse"]},"customer_interaction_type":{"type":"string","nullable":true,"enum":["ticket","sales_call"]}},"required":["id","name","type","customer_interaction_type"]},"slack_incoming_webhook":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"channel":{"type":"string"},"channel_id":{"type":"string"},"configuration_url":{"type":"string"}},"required":["id","channel","channel_id","configuration_url"]},"complaints_jira_request_type":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"}},"required":["id","external_id","name"]}},"required":["id","name","last_synced_at","reason_for_request_conversation_field","import_conversations_enabled","data_source","slack_incoming_webhook","complaints_jira_request_type"]},"compliance_events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"event_type":{"type":"string"},"author":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"disposition":{"type":"string","nullable":true},"reassigned_to":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","external_id","event_type","author","content","status","disposition","reassigned_to","provider_created_at","created_at"]}},"compliance_narratives":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"content":{"type":"string","nullable":true},"created_by":{"type":"string","nullable":true},"edited_by":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"provider_updated_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","content","created_by","edited_by","provider_created_at","provider_updated_at","created_at","updated_at"]}},"compliance_rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","raw_data","external_url","created_at","updated_at"]}},"compliance_alerts":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"disposition":{"type":"string","nullable":true},"disposition_notes":{"type":"string","nullable":true},"assigned_to":{"type":"string","nullable":true},"dispositioned_at":{"type":"string","nullable":true},"dispositioned_by":{"type":"string","nullable":true},"alert_type":{"type":"string","nullable":true},"provider_created_at":{"type":"string","nullable":true},"source":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"synced_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","status","disposition","disposition_notes","assigned_to","dispositioned_at","dispositioned_by","alert_type","provider_created_at","source","raw_data","external_url","synced_at","created_at","updated_at"]}}},"required":["id","status","disposition","external_id","title","description","source","disposition_notes","dispositioned_at","dispositioned_by","assigned_to","provider_created_at","raw_data","external_url","synced_at","created_at","updated_at","connection","compliance_events","compliance_narratives","compliance_rules","compliance_alerts"]}},"required":["data"]}}}},"404":{"description":"Compliance case not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_rules":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Organization compliance rules","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","raw_data","external_url","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_rules/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Compliance rule","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"raw_data":{"type":"object","additionalProperties":{"nullable":true}},"external_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","external_id","title","description","raw_data","external_url","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Compliance rule not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_frameworks":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"filter[query]","in":"query"}],"responses":{"200":{"description":"Compliance frameworks catalog, ordered by name","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}}},"required":["data"]}}}}}}},"/compliance_frameworks/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A compliance framework","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"openai_vector_store_id":{"type":"string","nullable":true},"source_urls":{"type":"array","nullable":true,"items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","description","openai_vector_store_id","source_urls","created_at","updated_at"]}},"required":["data"]}}}},"404":{"description":"Framework not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_criterion_groups":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"}],"responses":{"200":{"description":"Organization compliance criterion groups","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","created_at","updated_at","compliance_criterion_group_id"]}}},"required":["id","name","created_at","updated_at","criteria"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_criterion_group":{"type":"object","properties":{"name":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"_destroy":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]}}}}}}},"required":["compliance_criterion_group"]}}}},"responses":{"201":{"description":"Criterion group created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","created_at","updated_at","compliance_criterion_group_id"]}}},"required":["id","name","created_at","updated_at","criteria"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/compliance_criterion_groups/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A compliance criterion group","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","created_at","updated_at","compliance_criterion_group_id"]}}},"required":["id","name","created_at","updated_at","criteria"]}},"required":["data"]}}}},"404":{"description":"Compliance criterion group not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_criterion_group":{"type":"object","properties":{"name":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"_destroy":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]}}}}}}},"required":["compliance_criterion_group"]}}}},"responses":{"200":{"description":"Criterion group updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","created_at","updated_at","compliance_criterion_group_id"]}}},"required":["id","name","created_at","updated_at","criteria"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"put":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"compliance_criterion_group":{"type":"object","properties":{"name":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"_destroy":{"anyOf":[{"type":"boolean"},{"type":"string"},{"type":"number"},{"nullable":true}]}}}}}}},"required":["compliance_criterion_group"]}}}},"responses":{"200":{"description":"Criterion group updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"criteria":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"compliance_criterion_group_id":{"type":"string","nullable":true}},"required":["id","description","created_at","updated_at","compliance_criterion_group_id"]}}},"required":["id","name","created_at","updated_at","criteria"]}},"required":["data"]}}}},"400":{"description":"Validation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"errors":{"type":"object","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["error","errors"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Criterion group discarded"},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/disputes":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string","description":"JSON object: {\"query\",\"status_group\",\"reported_after\",\"reported_before\",\"client_id\"}"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Organization disputes","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["open","resolved"]},"resolution_due_at":{"type":"string"},"resolution_summary":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"filed_at":{"type":"string"},"currency_code":{"type":"string","nullable":true},"acknowledged_at":{"type":"string","nullable":true},"acknowledgement_due_at":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"reporter":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"jira_issue_key":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"amount":{"type":"number","nullable":true}},"required":["id","summary","status","resolution_due_at","resolution_summary","created_at","updated_at","resolved_at","filed_at","currency_code","acknowledged_at","acknowledgement_due_at","conversation_subject","company_name","reporter","jira_issue_key","conversation_id","amount"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"400":{"description":"Invalid filter","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/disputes/{id}":{"get":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"A dispute","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"summary":{"type":"string"},"status":{"type":"string","enum":["open","resolved"]},"resolution_due_at":{"type":"string"},"resolution_summary":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"resolved_at":{"type":"string","nullable":true},"filed_at":{"type":"string"},"currency_code":{"type":"string","nullable":true},"acknowledged_at":{"type":"string","nullable":true},"acknowledgement_due_at":{"type":"string","nullable":true},"conversation_subject":{"type":"string","nullable":true},"company_name":{"type":"string","nullable":true},"reporter":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"email":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"custom_attributes":{"nullable":true}},"required":["id","name","email","phone","created_at","updated_at"]},"jira_issue_key":{"type":"string","nullable":true},"conversation_id":{"type":"string","nullable":true},"amount":{"type":"number","nullable":true},"jira_issue":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"issue_key":{"type":"string"},"url":{"type":"string"},"summary":{"type":"string"},"status_category":{"type":"string","enum":["undefined","new","indeterminate","done"]},"created_at":{"type":"string"},"updated_at":{"type":"string"},"service_desk_url":{"type":"string","nullable":true},"request_field_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"value":{"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"jira_request_type_field":{"type":"object","nullable":true,"properties":{"id":{"type":"string","nullable":true},"name":{"type":"string"},"external_id":{"type":"string"},"description":{"type":"string","nullable":true},"required":{"type":"boolean"},"valid_values":{"nullable":true},"jira_schema_type":{"type":"string","nullable":true},"jira_schema_custom":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","description","required","jira_schema_type","jira_schema_custom","created_at","updated_at"]}},"required":["id","created_at","updated_at","jira_request_type_field"]}}},"required":["id","issue_key","url","summary","status_category","created_at","updated_at","service_desk_url","request_field_values"]}},"required":["id","summary","status","resolution_due_at","resolution_summary","created_at","updated_at","resolved_at","filed_at","currency_code","acknowledged_at","acknowledgement_due_at","conversation_subject","company_name","reporter","jira_issue_key","conversation_id","amount","jira_issue"]}},"required":["data"]}}}},"404":{"description":"Dispute not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/customer-issues/description/generate":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":255},"type":{"type":"string","enum":["product","service"]},"currentDescription":{"type":"string","nullable":true,"maxLength":10000},"prompt":{"type":"string","minLength":1,"maxLength":4000}},"required":["name","type","prompt"]}}}},"responses":{"200":{"description":"Generated customer issue description","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"description":{"type":"string","minLength":1,"description":"Short theme-summary customer issue description matching existing taxonomy style."}},"required":["description"],"additionalProperties":false}},"required":["data"]}}}},"400":{"description":"Invalid generation input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Missing permission","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Description generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/zendesk-brands":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"zendesk_brand":{"type":"object","properties":{"name":{"type":"string","minLength":1},"subdomain":{"type":"string","minLength":1},"external_id":{"type":"string","minLength":1},"organization_data_source_id":{"type":"string","minLength":1}},"required":["name","subdomain","external_id","organization_data_source_id"]}},"required":["zendesk_brand"]}}}},"responses":{"201":{"description":"Zendesk brand created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string"},"external_id":{"type":"string"},"tracking_status":{"type":"string","enum":["active","inactive"]},"avatar_url":{"type":"string","nullable":true},"teams_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","subdomain","external_id","tracking_status","avatar_url","teams_count","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Brand conflicts with an existing record or dependency","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/zendesk-brands/{id}":{"patch":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"zendesk_brand":{"type":"object","properties":{"name":{"type":"string","minLength":1},"subdomain":{"type":"string","minLength":1},"tracking_status":{"type":"string","enum":["active","inactive"]}}}},"required":["zendesk_brand"]}}}},"responses":{"200":{"description":"Zendesk brand updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"subdomain":{"type":"string"},"external_id":{"type":"string"},"tracking_status":{"type":"string","enum":["active","inactive"]},"avatar_url":{"type":"string","nullable":true},"teams_count":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","subdomain","external_id","tracking_status","avatar_url","teams_count","created_at","updated_at"]}},"required":["data"]}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Brand conflicts with an existing record or dependency","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Zendesk brand deleted"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Brand conflicts with an existing record or dependency","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/zendesk-brands/{id}/avatar":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true}}}}}},"responses":{"204":{"description":"Zendesk brand avatar uploaded"},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Brand not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/teams/{id}/import_members_preview":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true},"remove_missing_agents":{"type":"string"},"team_history_transfer_from":{"type":"string","description":"\"all\" to move the whole history of every agent joining from another team, or a YYYY-MM-DD date to move it from that day onwards. Omit to leave history with the previous teams."}}}}}},"responses":{"200":{"description":"Team import preview","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"preview":{"type":"object","properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}},"required":["added","removed"]}},"required":["success","preview"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/teams/{id}/import_members":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"nullable":true},"remove_missing_agents":{"type":"string"},"team_history_transfer_from":{"type":"string","description":"\"all\" to move the whole history of every agent joining from another team, or a YYYY-MM-DD date to move it from that day onwards. Omit to leave history with the previous teams."}}}}}},"responses":{"200":{"description":"Members imported","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","nullable":true},"message":{"type":"string"}},"required":["row","message"]}}},"required":["success","errors"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Team not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"422":{"description":"Import completed with row errors, or invalid team history transfer value","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"errors":{"type":"array","items":{"type":"object","properties":{"row":{"type":"number","nullable":true},"message":{"type":"string"}},"required":["row","message"]}}},"required":["success","errors"]}}}},"503":{"description":"Unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-base-folders":{"get":{"responses":{"200":{"description":"Organization knowledge base folders","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"position":{"type":"integer"},"createdByUserId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","position","createdByUserId","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000,"default":""},"position":{"type":"integer","default":0}},"required":["name"]}}}},"responses":{"201":{"description":"Organization knowledge base folder created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"position":{"type":"integer"},"createdByUserId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","position","createdByUserId","createdAt","updatedAt"]}},"required":["data"]}}}}}}},"/knowledge-base-folders/{folderId}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"folderId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":1000},"position":{"type":"integer"}}}}}},"responses":{"200":{"description":"Organization knowledge base folder updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"position":{"type":"integer"},"createdByUserId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","name","description","position","createdByUserId","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Knowledge base folder not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"folderId","in":"path"}],"responses":{"204":{"description":"Organization knowledge base folder deleted"},"404":{"description":"Knowledge base folder not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-base-documents":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"query","in":"query"}],"responses":{"200":{"description":"Organization knowledge base documents","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000},"folderId":{"type":"string","nullable":true,"format":"uuid"}},"required":["title","content"]}}}},"responses":{"201":{"description":"Organization knowledge base document created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid folder","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-base-documents/{documentId}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"responses":{"200":{"description":"Organization knowledge base document","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000},"folderId":{"type":"string","nullable":true,"format":"uuid"},"isEnabled":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Organization knowledge base document updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid folder","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"403":{"description":"System document is read-only","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"Organization knowledge base document deleted"},"403":{"description":"System document is read-only","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/knowledge-base-documents":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"organizationId","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"organizationSlug","in":"query"},{"schema":{"type":"string","minLength":1},"required":false,"name":"organizationName","in":"query"}],"responses":{"200":{"description":"System knowledge base documents for an organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"organizationSlug":{"type":"string","minLength":1},"organizationName":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000},"systemType":{"type":"string","enum":["general","onboarding"],"default":"onboarding"},"isEnabled":{"type":"boolean","default":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["organizationId","title","content"]}}}},"responses":{"201":{"description":"System knowledge base document created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/knowledge-base-documents/{documentId}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":300},"content":{"type":"string","minLength":1,"maxLength":200000},"systemType":{"type":"string","enum":["general","onboarding"]},"isEnabled":{"type":"boolean"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}}}}},"responses":{"200":{"description":"System knowledge base document updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"agentId":{"type":"string","nullable":true},"ownerType":{"type":"string","enum":["organization"]},"ownerId":{"type":"string"},"folderId":{"type":"string","nullable":true},"title":{"type":"string"},"content":{"type":"string"},"isEnabled":{"type":"boolean"},"managedBy":{"type":"string","enum":["user","system"]},"systemType":{"type":"string","nullable":true,"enum":["general","onboarding"]},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"createdByUserId":{"type":"string","nullable":true},"authorName":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","organizationId","agentId","ownerType","ownerId","folderId","title","content","isEnabled","managedBy","systemType","metadata","createdByUserId","authorName","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"System knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"documentId","in":"path"}],"responses":{"204":{"description":"System knowledge base document deleted"},"404":{"description":"System knowledge base document not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-base-sources/intercom":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"connectionId":{"type":"string","format":"uuid"}},"required":["connectionId"]}}}},"responses":{"201":{"description":"Intercom knowledge base source created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["intercom"]},"syncStatus":{"type":"string","enum":["pending","in_progress","completed","failed"]}},"required":["id","type","syncStatus"]}},"required":["data"]}}}},"400":{"description":"Connection cannot back an Intercom knowledge base","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"409":{"description":"Source already exists","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/knowledge-base-sources/intercom/{sourceId}/sync":{"post":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"sourceId","in":"path"}],"responses":{"202":{"description":"Intercom knowledge base sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Source not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/status-rss":{"get":{"responses":{"200":{"description":"Status RSS connections for the organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["status_rss"]},"authType":{"type":"string"},"status":{"type":"string"},"externalAccountName":{"type":"string","nullable":true},"feedUrl":{"type":"string"},"label":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","nullable":true},"lastSyncStatus":{"type":"string","nullable":true,"enum":["pending","success","failed"]},"lastSyncError":{"type":"string","nullable":true},"lastSyncItemCount":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","authType","status","externalAccountName","feedUrl","label","lastSyncedAt","lastSyncStatus","lastSyncError","lastSyncItemCount","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feed_url":{"type":"string","format":"uri"},"label":{"type":"string","minLength":1}},"required":["feed_url"]}}}},"responses":{"200":{"description":"Status RSS connection created or updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["status_rss"]},"authType":{"type":"string"},"status":{"type":"string"},"externalAccountName":{"type":"string","nullable":true},"feedUrl":{"type":"string"},"label":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","nullable":true},"lastSyncStatus":{"type":"string","nullable":true,"enum":["pending","success","failed"]},"lastSyncError":{"type":"string","nullable":true},"lastSyncItemCount":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","authType","status","externalAccountName","feedUrl","label","lastSyncedAt","lastSyncStatus","lastSyncError","lastSyncItemCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid Status RSS URL or feed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/status-rss/{id}":{"patch":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"feed_url":{"type":"string","format":"uri"},"label":{"type":"string","minLength":1}},"required":["feed_url"]}}}},"responses":{"200":{"description":"Status RSS connection updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string","enum":["status_rss"]},"authType":{"type":"string"},"status":{"type":"string"},"externalAccountName":{"type":"string","nullable":true},"feedUrl":{"type":"string"},"label":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","nullable":true},"lastSyncStatus":{"type":"string","nullable":true,"enum":["pending","success","failed"]},"lastSyncError":{"type":"string","nullable":true},"lastSyncItemCount":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","provider","authType","status","externalAccountName","feedUrl","label","lastSyncedAt","lastSyncStatus","lastSyncError","lastSyncItemCount","createdAt","updatedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid Status RSS URL or feed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"No Status RSS connection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Status RSS connection deleted"},"404":{"description":"No Status RSS connection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/connections/status-rss/{id}/sync":{"post":{"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"202":{"description":"Status RSS sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"connectionId":{"type":"string"}},"required":["message","connectionId"]}}}},"404":{"description":"No Status RSS connection","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/link-previews":{"get":{"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":2048},"required":true,"name":"url","in":"query"}],"responses":{"200":{"description":"Link preview metadata","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"url":{"type":"string"},"title":{"type":"string","nullable":true},"imageUrl":{"type":"string","nullable":true},"fetchedAt":{"type":"string"}},"required":["url","title","imageUrl","fetchedAt"]}},"required":["data"]}}}},"400":{"description":"Invalid link preview URL","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/lists":{"get":{"responses":{"200":{"description":"Organization lists","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"recordType":{"type":"string"},"displayColumns":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","recordType","displayColumns","createdAt","updatedAt"]}}},"required":["data"]}}}}}},"post":{"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300}}}}}},"responses":{"201":{"description":"List created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"recordType":{"type":"string"},"displayColumns":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","recordType","displayColumns","createdAt","updatedAt"]}},"required":["data"]}}}}}}},"/lists/column-catalog":{"get":{"responses":{"200":{"description":"Available onboarding list columns","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","enum":["domain","external_id","description","ubo_status","risk_level","onboarding_case_status","document_status","documents_missing","onboarding_status_summary","in_remediation","created_at","updated_at"]},"label":{"type":"string"},"description":{"type":"string"},"group":{"type":"string","enum":["company","onboarding"]}},"required":["key","label","description","group"]}}},"required":["data"]}}}}}}},"/lists/{id}":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List metadata","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"recordType":{"type":"string"},"displayColumns":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","recordType","displayColumns","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":300},"displayColumns":{"type":"array","items":{"type":"string"},"minItems":1}}}}}},"responses":{"200":{"description":"List updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"recordType":{"type":"string"},"displayColumns":{"type":"array","items":{"type":"string"}},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","name","recordType","displayColumns","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"List deleted"},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/lists/{id}/companies":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Companies in list order","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"domainNames":{"type":"array","items":{"type":"string"}},"logoUrl":{"type":"string","nullable":true,"format":"uri"},"externalId":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"columnValues":{"type":"object","additionalProperties":{"type":"string","nullable":true}},"documentsMissing":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"label":{"type":"string"}},"required":["id","label"]}}},"required":["id","name","description","domainNames","logoUrl","externalId","createdAt","updatedAt","columnValues","documentsMissing"]}}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/lists/{id}/chats":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"List onboarding list chats","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","title","createdAt","updatedAt"]}}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/lists/{listId}/views":{"get":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"listId","in":"path"}],"responses":{"200":{"description":"List views for a list","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"listId":{"type":"string","format":"uuid"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","listId","name","position","createdAt","updatedAt"]}}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"listId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}}},"required":["name"]}}}},"responses":{"201":{"description":"List view created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"listId":{"type":"string","format":"uuid"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","listId","name","position","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"List not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/lists/{listId}/views/{viewId}":{"patch":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"listId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"viewId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":255},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}}}}}}},"responses":{"200":{"description":"List view updated","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"listId":{"type":"string","format":"uuid"},"name":{"type":"string"},"filters":{"type":"object","additionalProperties":{"nullable":true},"default":{}},"position":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","listId","name","position","createdAt","updatedAt"]}},"required":["data"]}}}},"404":{"description":"List or view not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"delete":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"listId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"viewId","in":"path"}],"responses":{"204":{"description":"List view deleted"},"404":{"description":"List or view not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/onboarding/list-proposals/{id}/apply":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Applied list proposal","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"},"items_added":{"type":"integer"},"items_removed":{"type":"integer"},"list_url":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"required":["data"]}}}},"404":{"description":"Proposal not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/onboarding/campaign-proposals/{id}/apply":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Applied campaign proposal","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"},"campaign_id":{"type":"string","format":"uuid"},"campaign_url":{"type":"string"},"items_added":{"type":"integer"},"error":{"type":"string"}},"required":["success"]}},"required":["data"]}}}},"404":{"description":"Proposal not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/onboarding/task-proposals/{id}/apply":{"post":{"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Applied task proposal","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"success":{"type":"boolean"},"tasks_created":{"type":"integer"},"tasks_url":{"type":"string"},"error":{"type":"string"}},"required":["success"]}},"required":["data"]}}}},"404":{"description":"Proposal not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/demo/paystack/attachments":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"merchantLegalName":{"type":"string","minLength":1},"merchantTradingName":{"type":"string","minLength":1},"merchantEmail":{"type":"string","format":"email"},"merchantWebsite":{"type":"string","format":"uri"}},"required":["merchantLegalName","merchantTradingName"]}}}},"responses":{"200":{"description":"Paystack demo attachments archive","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Attachment generation failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/demo/paystack/front-conversation":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"demoUseCase":{"type":"string","enum":["fast_track","low_quality"],"default":"fast_track"},"frontInboxId":{"type":"string","minLength":1},"toAddress":{"type":"string","format":"email","default":"chidi@rulebase.co"},"merchantLegalName":{"type":"string","minLength":1,"default":"Acme Logistics"},"merchantTradingName":{"type":"string","minLength":1,"default":"Acme Logistics"},"merchantEmail":{"type":"string","format":"email","default":"chidi@rulebase.co"},"registrationType":{"type":"string","enum":["starter_business","sole_proprietorship","registered_business"],"default":"registered_business"},"merchantWebsite":{"type":"string","format":"uri","default":"https://app.rulebase.co/demo/paystack-logistics?merchant=Acme+Logistics&seed=default&domain=acmelogistics.com&use_case=fast_track"}},"required":["frontInboxId"]}}}},"responses":{"202":{"description":"Paystack demo Front conversation import accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"externalId":{"type":"string"},"subject":{"type":"string"},"frontInboxId":{"type":"string"},"merchantEmail":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"frontConversationUrl":{"type":"string","nullable":true,"format":"uri"},"frontResponse":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["externalId","subject","frontInboxId","merchantEmail","tags","frontConversationUrl","frontResponse"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"500":{"description":"Front API key missing","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Front API request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/scribe-sync":{"get":{"parameters":[{"schema":{"type":"string","minLength":1},"required":true,"name":"organizationId","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200},"required":false,"name":"accountId","in":"query"}],"responses":{"200":{"description":"Scribe connection and sync status for an organization","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"status":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true},"lastErrorAt":{"type":"string","nullable":true}},"required":["id","accountId","status","lastUsedAt","lastErrorAt"]},"source":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"accountId":{"type":"string"},"syncStatus":{"type":"string"},"documentsCount":{"type":"integer"},"lastSyncedAt":{"type":"string","nullable":true}},"required":["id","accountId","syncStatus","documentsCount","lastSyncedAt"]},"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"scribeDocumentId":{"type":"string","nullable":true},"title":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"lastSyncedAt":{"type":"string","nullable":true},"discardedAt":{"type":"string","nullable":true}},"required":["id","scribeDocumentId","title","url","lastSyncedAt","discardedAt"]}}},"required":["connection","source","documents"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}},"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"accountId":{"type":"string","minLength":1,"maxLength":200},"accessToken":{"type":"string","minLength":20,"maxLength":4000}},"required":["organizationId","accountId","accessToken"]}}}},"responses":{"202":{"description":"Scribe connection saved and a sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"connection":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"status":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true},"lastErrorAt":{"type":"string","nullable":true}},"required":["id","accountId","status","lastUsedAt","lastErrorAt"]},"source":{"type":"object","properties":{"id":{"type":"string"},"accountId":{"type":"string"},"syncStatus":{"type":"string"},"documentsCount":{"type":"integer"},"lastSyncedAt":{"type":"string","nullable":true}},"required":["id","accountId","syncStatus","documentsCount","lastSyncedAt"]}},"required":["connection","source"]}}}},"404":{"description":"Organization not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"502":{"description":"Scribe request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/scribe-sync/preview":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"accessToken":{"type":"string","minLength":20,"maxLength":4000}},"required":["accessToken"]}}}},"responses":{"200":{"description":"Scribe workspace documents visible to the pasted token","content":{"application/json":{"schema":{"type":"object","properties":{"documents":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"type":{"type":"string","nullable":true},"updatedAt":{"type":"string","nullable":true}},"required":["id","name","type","updatedAt"]}}},"required":["documents"]}}}},"502":{"description":"Scribe request failed","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/scribe-sync/sync":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organizationId":{"type":"string","minLength":1},"accountId":{"type":"string","minLength":1,"maxLength":200},"accessToken":{"type":"string","minLength":20,"maxLength":4000}},"required":["organizationId","accountId"]}}}},"responses":{"202":{"description":"Scribe sync enqueued","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"404":{"description":"Organization or Scribe source not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/admin/demo/rwa/reset":{"post":{"responses":{"200":{"description":"Fern & Finch RWA demo reset","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"deletedComments":{"type":"integer"},"deletedSubmissions":{"type":"integer"},"deletedTasks":{"type":"integer"}},"required":["deletedComments","deletedSubmissions","deletedTasks"]}},"required":["data"]}}}},"403":{"description":"Forbidden","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Fern & Finch demo company not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/slack/channels":{"get":{"parameters":[{"schema":{"type":"string"},"required":false,"name":"query","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Postable Slack channels for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true},"slackChannelId":{"type":"string"},"numMembers":{"type":"integer","nullable":true},"connection":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string","nullable":true}},"required":["id","name"]}},"required":["id","name","slackChannelId","numMembers","connection"]}}},"required":["data"]}}}}}}},"/internal/slack/channel-notifications":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"api2_slack_channel_id":{"type":"string","format":"uuid"},"slack_channel_id":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"blocks":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"thread_ts":{"type":"string","minLength":1},"assistant_thread":{"type":"object","properties":{"source":{"type":"string","minLength":1},"context":{"type":"object","additionalProperties":{"type":"string","maxLength":200}},"alert_card_text":{"type":"string","maxLength":4000}},"required":["source"]}},"required":["organization_id","text"]}}}},"responses":{"200":{"description":"Slack notification sent","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"api2SlackChannelId":{"type":"string","format":"uuid"},"channelId":{"type":"string"},"ts":{"type":"string"}},"required":["ok","api2SlackChannelId","channelId","ts"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Slack channel not found or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/internal/slack/assistant-threads":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"organization_id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"slack_channel_id":{"type":"string","minLength":1},"thread_ts":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"context":{"type":"object","additionalProperties":{"type":"string","maxLength":200}},"alert_card_text":{"type":"string","maxLength":4000}},"required":["organization_id","slack_channel_id","thread_ts","text","source"]}}}},"responses":{"200":{"description":"Thread registered for assistant follow-up replies","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"registered":{"type":"boolean"}},"required":["ok","registered"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Slack channel not found or unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/slack_channels":{"get":{"parameters":[{"schema":{"type":"integer","minimum":0,"exclusiveMinimum":true},"required":false,"name":"page[page]","in":"query"},{"schema":{"type":"integer","description":"Values above 100 are clamped to 100","minimum":1},"required":false,"name":"page[limit]","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filter[query]","in":"query"}],"responses":{"200":{"description":"Rails Slack channels for the current organization","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_id":{"type":"string"},"organization_data_source_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","external_id","organization_data_source_id","created_at","updated_at"]}},"meta":{"type":"object","properties":{"page":{"type":"object","properties":{"next":{"type":"number","nullable":true},"limit":{"type":"number"},"total":{"type":"number"}},"required":["next","limit","total"]}},"required":["page"]}},"required":["data","meta"]}}}},"503":{"description":"Rails organization unavailable","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}},"/webhooks/rulebase":{"post":{"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"eventType":{"type":"string","enum":["ticket_created"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"transcript":{"type":"string"},"interactionType":{"type":"string"},"externalId":{"type":"string"},"connection":{"type":"object","properties":{"rulebaseId":{"type":"string"},"integration":{"type":"object","properties":{"uid":{"type":"string"},"name":{"type":"string"}},"required":["uid","name"]}},"required":["rulebaseId","integration"]}},"required":["id","prefixId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["ticket_updated"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"transcript":{"type":"string"},"interactionType":{"type":"string"},"externalId":{"type":"string"},"connection":{"type":"object","properties":{"rulebaseId":{"type":"string"},"integration":{"type":"object","properties":{"uid":{"type":"string"},"name":{"type":"string"}},"required":["uid","name"]}},"required":["rulebaseId","integration"]}},"required":["id","prefixId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["conversation_assigned"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"number"},"prefixId":{"type":"string"},"assigneeMembershipId":{"type":"string"}},"required":["id","prefixId","assigneeMembershipId"]}},"required":["eventType","organizationId","conversation"]},{"type":"object","properties":{"eventType":{"type":"string","enum":["conversation_synced"]},"organizationId":{"type":"string"},"conversation":{"type":"object","properties":{"id":{"type":"integer","minimum":0,"exclusiveMinimum":true},"prefixId":{"type":"string"}},"required":["id","prefixId"]},"features":{"type":"object","properties":{"topicEmbeddingEnabled":{"type":"boolean"},"salesCallCompliancePipelineEnabled":{"type":"boolean"}},"required":["topicEmbeddingEnabled"]}},"required":["eventType","organizationId","conversation","features"]}]}}}},"responses":{"202":{"description":"Webhook accepted","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"accepted":{"type":"boolean"},"matchedAgents":{"type":"number"},"persistedConversation":{"type":"boolean"},"storedViewCreated":{"type":"boolean"},"storedViewId":{"type":"string","nullable":true},"redactionJobIds":{"type":"array","items":{"type":"string"}},"topicEmbeddingJobId":{"type":"string","nullable":true},"customerIssueAssignmentJobId":{"type":"string","nullable":true},"salesCallComplianceJobId":{"type":"string","nullable":true},"slaTargetOutcomeCheckJobId":{"type":"string","nullable":true},"outcomeEvaluateJobIds":{"type":"array","items":{"type":"string"}},"callSummaryNotificationJobIds":{"type":"array","items":{"type":"string"}}},"required":["accepted","matchedAgents","persistedConversation"]}},"required":["data"]}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}},"404":{"description":"Conversation not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}},"required":["error"]}}}}}}}}}