{"openapi":"3.1.0","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/api/login":{"post":{"summary":"Login","operationId":"login_api_login_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Login"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/logout":{"post":{"summary":"Logout","operationId":"logout_api_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/me":{"get":{"summary":"Me","operationId":"me_api_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/team/home":{"get":{"summary":"Team Home","description":"The team's own numbers: only tickets handed to people.","operationId":"team_home_api_team_home_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/team/scores":{"get":{"summary":"Team Score Detail","description":"Last 7 days: what customers rated, what the AI rated and what it is\nbased on. A team member sees their own; the owner sees everyone.","operationId":"team_score_detail_api_team_scores_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/team/tickets":{"get":{"summary":"Team Tickets","operationId":"team_tickets_api_team_tickets_get","parameters":[{"name":"tab","in":"query","required":false,"schema":{"type":"string","default":"open","title":"Tab"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/overview":{"get":{"summary":"Overview","operationId":"overview_api_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/dashboard":{"get":{"summary":"Dashboard","description":"The owner's dashboard for one period: what came in, what the AI\nsettled, what reached the team, and how the team did.","operationId":"dashboard_api_dashboard_get","parameters":[{"name":"period","in":"query","required":false,"schema":{"type":"string","default":"today","title":"Period"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets":{"get":{"summary":"Tickets","operationId":"tickets_api_tickets_get","parameters":[{"name":"queue","in":"query","required":false,"schema":{"type":"string","default":"needs_team","title":"Queue"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","default":"","title":"Q"}},{"name":"category","in":"query","required":false,"schema":{"type":"string","default":"","title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/file":{"get":{"summary":"Ticket File","description":"Open a customer's photo, video or PDF through a link Freshdesk has just signed.","operationId":"ticket_file_api_tickets__ticket_id__file_get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}},{"name":"k","in":"query","required":false,"schema":{"type":"string","default":"","title":"K"}},{"name":"n","in":"query","required":false,"schema":{"type":"string","default":"","title":"N"}},{"name":"u","in":"query","required":false,"schema":{"type":"string","default":"","title":"U"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/shiprocket-orders":{"get":{"summary":"Ticket Shiprocket Orders","description":"All of this customer's Shiprocket orders, matched on their phone number.","operationId":"ticket_shiprocket_orders_api_tickets__ticket_id__shiprocket_orders_get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/earlier":{"get":{"summary":"Ticket Earlier","description":"The customer's other tickets (same email, last 120 days), newest first,\nso the team sees photos and messages sent on an earlier ticket (Riya, 2 Dec).","operationId":"ticket_earlier_api_tickets__ticket_id__earlier_get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}":{"get":{"summary":"Ticket Detail","description":"fast=1 answers at once from the saved copy, with partial=true when\nFreshdesk, Shopify or Shiprocket still need to be read; the page then\nasks again without fast and fills in what changed.","operationId":"ticket_detail_api_tickets__ticket_id__get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}},{"name":"fast","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Fast"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/reply":{"post":{"summary":"Send Reply","operationId":"send_reply_api_tickets__ticket_id__reply_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/improve-preview":{"post":{"summary":"Admin Improve Preview","description":"Read-only check of the AI reply improver on a real ticket (nothing sent).","operationId":"admin_improve_preview_api_admin_improve_preview_post","parameters":[{"name":"ticket_id","in":"query","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/improve":{"post":{"summary":"Improve Reply","description":"The team member's text, rewritten by the AI into a full reply. Nothing\nis sent here: the team member reads it, can edit it, then sends.","operationId":"improve_reply_api_tickets__ticket_id__improve_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/reply-files":{"post":{"summary":"Send Reply Files","description":"The same as a reply, with photos, videos or PDFs attached.","operationId":"send_reply_files_api_tickets__ticket_id__reply_files_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/note":{"post":{"summary":"Add Note","operationId":"add_note_api_tickets__ticket_id__note_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/close":{"post":{"summary":"Close Ticket","operationId":"close_ticket_api_tickets__ticket_id__close_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/done":{"post":{"summary":"Mark Done","description":"Take it off the team's list without mailing the customer, and close\nit in Freshdesk as well.","operationId":"mark_done_api_tickets__ticket_id__done_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/working":{"post":{"summary":"Working","description":"Called while a team member has a ticket open, so two people do not\nwork the same ticket. Says who else has it, if anyone.","operationId":"working_api_tickets__ticket_id__working_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Working"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/later":{"post":{"summary":"Come Back Later","description":"Park a ticket the team member will come back to. It stays open and\ntheirs, in its own list, until they reply or mark it done.","operationId":"come_back_later_api_tickets__ticket_id__later_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Later"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/undo-done":{"post":{"summary":"Undo Done","operationId":"undo_done_api_tickets__ticket_id__undo_done_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/escalate":{"post":{"summary":"Escalate","operationId":"escalate_api_tickets__ticket_id__escalate_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Escalate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outbox":{"get":{"summary":"Outbox","operationId":"outbox_api_outbox_get","parameters":[{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"","title":"Kind"}},{"name":"all","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"All"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outbox/add":{"post":{"summary":"Outbox Add","description":"The email bot adds an unshipped order to Pankaj's list by itself.","operationId":"outbox_add_api_outbox_add_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutboxAdd"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/delivery":{"get":{"summary":"Admin Delivery","description":"Bounce mails of the last day (replies Google could not deliver).","operationId":"admin_delivery_api_admin_delivery_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/delivery/check":{"post":{"summary":"Admin Delivery Check","operationId":"admin_delivery_check_api_admin_delivery_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/outbox/urgent":{"get":{"summary":"Outbox Urgent","description":"Orders sent to Pankaj some days ago that still have not shipped and\nhave not had an urgent message yet.","operationId":"outbox_urgent_api_outbox_urgent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/outbox/outcome":{"post":{"summary":"Outbox Outcome","operationId":"outbox_outcome_api_outbox_outcome_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Outcome"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outbox/sent":{"post":{"summary":"Outbox Sent","operationId":"outbox_sent_api_outbox_sent_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/outbox/skip":{"post":{"summary":"Outbox Skip","description":"Clear items that will never be sent (already shipped, cancelled...).","operationId":"outbox_skip_api_outbox_skip_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sent"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/claims/assess":{"post":{"summary":"Claims Assess","description":"The email bot asks what the rules say about a complaint. The answer\ncarries the reply to send and whether the team takes over.","operationId":"claims_assess_api_claims_assess_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assess"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/claims":{"get":{"summary":"Claims Page","operationId":"claims_page_api_claims_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/claims/{claim_id}/approve":{"post":{"summary":"Claims Approve","operationId":"claims_approve_api_claims__claim_id__approve_post","parameters":[{"name":"claim_id","in":"path","required":true,"schema":{"type":"integer","title":"Claim Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decide"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/claims/{claim_id}/reject":{"post":{"summary":"Claims Reject","operationId":"claims_reject_api_claims__claim_id__reject_post","parameters":[{"name":"claim_id","in":"path","required":true,"schema":{"type":"integer","title":"Claim Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Decide"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upi-refunds/{row_id}/paid":{"post":{"summary":"Upi Refund Paid","operationId":"upi_refund_paid_api_upi_refunds__row_id__paid_post","parameters":[{"name":"row_id","in":"path","required":true,"schema":{"type":"integer","title":"Row Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upi-refunds":{"get":{"summary":"Upi Refunds","description":"Read by the task that copies UPI refunds into the team's refund sheet.\nunsynced=1 gives the rows not yet in the sheet, in the sheet's own columns.","operationId":"upi_refunds_api_upi_refunds_get","parameters":[{"name":"all","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"All"}},{"name":"unsynced","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Unsynced"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/upi-refunds/synced":{"post":{"summary":"Upi Refunds Synced","operationId":"upi_refunds_synced_api_upi_refunds_synced_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Synced"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/claims/selftest":{"get":{"summary":"Claims Selftest","description":"Read-only check that the helpdesk can do what the rules need.","operationId":"claims_selftest_api_claims_selftest_get","parameters":[{"name":"pincode","in":"query","required":false,"schema":{"type":"string","default":"110035","title":"Pincode"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","default":"","title":"Order"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/alert-text":{"get":{"summary":"Alert Text Now","description":"The count message as it would be posted now, plus the Monday one when\nit is due. Used when the message is posted from outside the helpdesk.","operationId":"alert_text_now_api_admin_alert_text_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/alert-sent":{"post":{"summary":"Alert Sent","description":"Record that the count message went out, so the next one counts new tickets from now.","operationId":"alert_sent_api_admin_alert_sent_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/reset-scores":{"post":{"summary":"Reset Scores","description":"Set the team's handled counts and ratings back to zero from now.","operationId":"reset_scores_api_admin_reset_scores_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/close-check":{"get":{"summary":"Close Check Status","operationId":"close_check_status_api_admin_close_check_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/close-done":{"post":{"summary":"Close All Done","description":"Close in Freshdesk every ticket a person marked done here that is\nstill open there. Runs in the background at the sync's pace.","operationId":"close_all_done_api_admin_close_done_post","parameters":[{"name":"dry","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Dry"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/claims/{claim_id}/hold-replacement":{"post":{"summary":"Hold Replacement","operationId":"hold_replacement_api_admin_claims__claim_id__hold_replacement_post","parameters":[{"name":"claim_id","in":"path","required":true,"schema":{"type":"integer","title":"Claim Id"}},{"name":"dry","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Dry"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/tickets/{ticket_id}/ai-note":{"post":{"summary":"Ai Note","description":"A person tells the AI what to do on this ticket; the email bot writes\nand sends the reply on that basis within a minute or two.","operationId":"ai_note_api_tickets__ticket_id__ai_note_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Text"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/tickets/{ticket_id}/settle":{"post":{"summary":"Admin Settle","operationId":"admin_settle_api_admin_tickets__ticket_id__settle_post","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"integer","title":"Ticket Id"}},{"name":"by","in":"query","required":false,"schema":{"type":"string","default":"Mihir","title":"By"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-notes":{"get":{"summary":"Ai Notes","operationId":"ai_notes_api_ai_notes_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/ai-notes/done":{"post":{"summary":"Ai Note Done","operationId":"ai_note_done_api_ai_notes_done_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AiNoteDone"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/backlog":{"get":{"summary":"Backlog","description":"Old tickets still waiting for the team, oldest first, for the email bot.","operationId":"backlog_api_backlog_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":3,"title":"Limit"}},{"name":"min_age_hours","in":"query","required":false,"schema":{"type":"number","default":24,"title":"Min Age Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/backlog/done":{"post":{"summary":"Backlog Done","operationId":"backlog_done_api_backlog_done_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BacklogDone"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/hold-all":{"post":{"summary":"Hold All","description":"Switch-over: hide everything now waiting for the team until the AI has\ngone through it. A ticket the AI never reaches shows again after the hold.","operationId":"hold_all_api_admin_hold_all_post","parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"number","default":20,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/held":{"get":{"summary":"Held","operationId":"held_api_admin_held_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/admin/fd-raw":{"get":{"summary":"Admin Fd Raw","description":"Read-only: the Freshdesk ticket and its conversations as Freshdesk has\nthem (who each reply went to, from which address, public or private), to\ncheck whether replies really went out to the customer.","operationId":"admin_fd_raw_api_admin_fd_raw_get","parameters":[{"name":"ticket_id","in":"query","required":true,"schema":{"type":"integer","title":"Ticket Id"}},{"name":"full","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Full"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ticket-view":{"get":{"summary":"Admin Ticket View","description":"Read-only: what the team sees for a ticket (thread with full mails, and\nthe customer's earlier tickets). For checking the ticket view.","operationId":"admin_ticket_view_api_admin_ticket_view_get","parameters":[{"name":"ticket_id","in":"query","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/find":{"get":{"summary":"Admin Find","description":"Read-only: tickets whose subject, first mail or conversation mention q.","operationId":"admin_find_api_admin_find_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/ticket-events":{"get":{"summary":"Admin Ticket Events","description":"Who did what on one ticket (reply, note, escalate, close), newest first.\nRead-only, for the owner's checks from another Hatke service.","operationId":"admin_ticket_events_api_admin_ticket_events_get","parameters":[{"name":"ticket_id","in":"query","required":true,"schema":{"type":"integer","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/order":{"post":{"summary":"Chat Order","operationId":"chat_order_api_chat_order_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/cancel":{"post":{"summary":"Chat Cancel","operationId":"chat_cancel_api_chat_cancel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/case":{"post":{"summary":"Chat Case","operationId":"chat_case_api_chat_case_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot/cancel-unshipped":{"post":{"summary":"Bot Cancel Unshipped","operationId":"bot_cancel_unshipped_api_bot_cancel_unshipped_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BotCancel"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot/shiprocket-orders":{"get":{"summary":"Bot Shiprocket Orders","description":"The same history for the bots and checks, by phone and/or email.","operationId":"bot_shiprocket_orders_api_bot_shiprocket_orders_get","parameters":[{"name":"phone","in":"query","required":false,"schema":{"type":"string","default":"","title":"Phone"}},{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot/tickets-for-order":{"get":{"summary":"Bot Tickets For Order","description":"Tickets waiting with the team that mention this order.","operationId":"bot_tickets_for_order_api_bot_tickets_for_order_get","parameters":[{"name":"order_no","in":"query","required":true,"schema":{"type":"string","title":"Order No"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot/settle":{"post":{"summary":"Bot Settle","description":"After the order behind a ticket has been dealt with (re-shipped,\ncancelled): send the customer the final reply and close the ticket, or\nwith no text just take it off the team's list. Only for tickets that\nare waiting with the team.","operationId":"bot_settle_api_bot_settle_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Settle"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/bot/correct":{"post":{"summary":"Bot Correct","description":"Send a customer a correction to something the AI told them earlier,\non a ticket that is already finished. The ticket stays closed and the\ncorrection is written down. Not for tickets waiting with the team.","operationId":"bot_correct_api_bot_correct_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Correction"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/resend":{"post":{"summary":"Admin Resend","description":"Send a reply again that Freshdesk failed to deliver (Freshworks mail\noutage, 25-30 Nov 2026). Without text: the ticket's latest public reply\nis sent again with an apology line, unless the customer wrote after it.\nStatus is left as it is; each ticket is resent once only.","operationId":"admin_resend_api_admin_resend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resend"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/resend-batch":{"get":{"summary":"Admin Resend Status","operationId":"admin_resend_status_api_admin_resend_batch_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}},"post":{"summary":"Admin Resend Batch","description":"Queue tickets whose failed reply should be sent again (see /api/admin/resend).","operationId":"admin_resend_batch_api_admin_resend_batch_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendBatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/admin/resend-batch/remove":{"post":{"summary":"Admin Resend Remove","description":"Take tickets out of the resend queue and never resend them.","operationId":"admin_resend_remove_api_admin_resend_batch_remove_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendBatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/refund":{"post":{"summary":"Chat Refund","operationId":"chat_refund_api_chat_refund_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/delivery-problem":{"post":{"summary":"Chat Delivery","operationId":"chat_delivery_api_chat_delivery_problem_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/address-change":{"post":{"summary":"Chat Address","operationId":"chat_address_api_chat_address_change_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/handoff":{"post":{"summary":"Chat Handoff","description":"The website bot hands a chat over to email. The reference lets the\nemail bot find this chat when the customer writes in.","operationId":"chat_handoff_api_chat_handoff_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatAsk"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/chat/context":{"get":{"summary":"Chat Context","operationId":"chat_context_api_chat_context_get","parameters":[{"name":"ref","in":"query","required":false,"schema":{"type":"string","default":"","title":"Ref"}},{"name":"order_no","in":"query","required":false,"schema":{"type":"string","default":"","title":"Order No"}},{"name":"email","in":"query","required":false,"schema":{"type":"string","default":"","title":"Email"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string","default":"","title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/analytics":{"get":{"summary":"Analytics","operationId":"analytics_api_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":7,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/refunds":{"get":{"summary":"Refunds","operationId":"refunds_api_refunds_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/f/{token}":{"get":{"summary":"Feedback Page","operationId":"feedback_page_f__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/feedback/{token}":{"post":{"summary":"Feedback Submit","operationId":"feedback_submit_api_feedback__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feedback"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team":{"get":{"summary":"Team Page","operationId":"team_page_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/manifest.webmanifest":{"get":{"summary":"Manifest","operationId":"manifest_manifest_webmanifest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/icon.svg":{"get":{"summary":"Icon","operationId":"icon_icon_svg_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/version":{"get":{"summary":"App Version","operationId":"app_version_api_version_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/":{"get":{"summary":"Index","operationId":"index__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}}},"components":{"schemas":{"AiNoteDone":{"properties":{"id":{"type":"integer","title":"Id"},"ok":{"type":"boolean","title":"Ok","default":true},"reply":{"type":"string","title":"Reply","default":""}},"type":"object","required":["id"],"title":"AiNoteDone"},"Assess":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"order_no":{"type":"string","title":"Order No"},"email":{"type":"string","title":"Email","default":""},"created_at":{"type":"string","title":"Created At","default":""},"facts":{"additionalProperties":true,"type":"object","title":"Facts","default":{}}},"type":"object","required":["ticket_id","order_no"],"title":"Assess"},"BacklogDone":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"action":{"type":"string","title":"Action","default":""}},"type":"object","required":["ticket_id"],"title":"BacklogDone"},"BotCancel":{"properties":{"order_no":{"type":"string","title":"Order No"},"ticket_id":{"type":"integer","title":"Ticket Id","default":0}},"type":"object","required":["order_no"],"title":"BotCancel"},"ChatAsk":{"properties":{"order_no":{"type":"string","title":"Order No","default":""},"email":{"type":"string","title":"Email","default":""},"phone":{"type":"string","title":"Phone","default":""},"conv_id":{"type":"string","title":"Conv Id","default":""},"note":{"type":"string","title":"Note","default":""},"summary":{"type":"string","title":"Summary","default":""},"transcript":{"type":"string","title":"Transcript","default":""},"new":{"additionalProperties":true,"type":"object","title":"New","default":{}},"quiet":{"type":"boolean","title":"Quiet","default":false}},"type":"object","title":"ChatAsk"},"Correction":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"text":{"type":"string","title":"Text"},"team_note":{"type":"string","title":"Team Note","default":""}},"type":"object","required":["ticket_id","text"],"title":"Correction"},"Decide":{"properties":{"reason":{"type":"string","title":"Reason","default":""},"courier_charge":{"type":"number","title":"Courier Charge","default":0}},"type":"object","title":"Decide"},"Escalate":{"properties":{"target":{"type":"string","title":"Target"},"message":{"type":"string","title":"Message","default":""}},"type":"object","required":["target"],"title":"Escalate"},"Feedback":{"properties":{"rating":{"type":"integer","title":"Rating"},"solved":{"type":"boolean","title":"Solved"},"comment":{"type":"string","title":"Comment","default":""}},"type":"object","required":["rating","solved"],"title":"Feedback"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Later":{"properties":{"on":{"type":"boolean","title":"On","default":true}},"type":"object","title":"Later"},"Login":{"properties":{"name":{"type":"string","title":"Name"},"password":{"type":"string","title":"Password"}},"type":"object","required":["name","password"],"title":"Login"},"OutboxAdd":{"properties":{"kind":{"type":"string","title":"Kind"},"order_no":{"type":"string","title":"Order No"},"ticket_id":{"type":"integer","title":"Ticket Id","default":0},"items":{"type":"string","title":"Items","default":""},"awb":{"type":"string","title":"Awb","default":""},"courier":{"type":"string","title":"Courier","default":""},"status_text":{"type":"string","title":"Status Text","default":""},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["kind","order_no"],"title":"OutboxAdd"},"Outcome":{"properties":{"id":{"type":"integer","title":"Id","default":0},"order_no":{"type":"string","title":"Order No","default":""},"outcome":{"type":"string","title":"Outcome"},"refund_amount":{"type":"number","title":"Refund Amount","default":0},"removed_items":{"items":{"type":"string"},"type":"array","title":"Removed Items","default":[]},"new_awb":{"type":"string","title":"New Awb","default":""},"cod":{"type":"boolean","title":"Cod","default":false},"note":{"type":"string","title":"Note","default":""}},"type":"object","required":["outcome"],"title":"Outcome"},"Resend":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"text":{"type":"string","title":"Text","default":""}},"type":"object","required":["ticket_id"],"title":"Resend"},"ResendBatch":{"properties":{"ids":{"items":{"type":"integer"},"type":"array","title":"Ids"}},"type":"object","required":["ids"],"title":"ResendBatch"},"Sent":{"properties":{"ids":{"items":{"type":"integer"},"type":"array","title":"Ids"},"reason":{"type":"string","title":"Reason","default":""}},"type":"object","required":["ids"],"title":"Sent"},"Settle":{"properties":{"ticket_id":{"type":"integer","title":"Ticket Id"},"text":{"type":"string","title":"Text","default":""}},"type":"object","required":["ticket_id"],"title":"Settle"},"Synced":{"properties":{"ids":{"items":{"type":"integer"},"type":"array","title":"Ids"},"note":{"type":"string","title":"Note","default":"in sheet"}},"type":"object","required":["ids"],"title":"Synced"},"Text":{"properties":{"text":{"type":"string","title":"Text"},"close":{"type":"boolean","title":"Close","default":false}},"type":"object","required":["text"],"title":"Text"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Working":{"properties":{"on":{"type":"boolean","title":"On","default":true},"take":{"type":"boolean","title":"Take","default":false}},"type":"object","title":"Working"}}}}