Files
gochat/backend/scripts/chatwoot_routes_manifest.py
T
rogee aeddedf2a3 Reorganize repo: backend/, deploy/, docs/ layout + AGENTS.md
Restructure the monorepo into clear top-level directories:
- backend/: Go module root (cmd, internal, pkg, configs, migrations,
  docs/swagger, scripts, tests, go.mod, Makefile, .air.toml)
- deploy/: Docker (Dockerfile, docker-compose*), quickstart, fluentd
- docs/: project documentation + reports/ (moved from repo root)
- AGENTS.md: new AI coding-agent guide at repo root

Update all references to the new layout:
- Dockerfile: COPY backend/go.mod, COPY backend/ (context = repo root)
- docker-compose files: context ../.., dockerfile deploy/docker/Dockerfile,
  env_file ../../.env, volume mounts ../../backend:/app
- deploy/quickstart/compose.yaml: dockerfile deploy/docker/Dockerfile
- CI: working-directory: backend for go commands, file deploy/docker/Dockerfile,
  coverage path backend/coverage.out, health_check backend/scripts/
- backend/Makefile: docker target uses -f ../deploy/docker/Dockerfile ../
- README: architecture tree, quickstart, config paths updated

Move root stray scripts (rename_models.*, run_m11_tests.sh, verify_build.sh,
gorm_bool_main.go) to backend/scripts/legacy/. All moves via git mv to
preserve history. Build, vet, SQLite tests, and docker compose config verified.
2026-07-07 14:44:12 +08:00

693 lines
46 KiB
Python

#!/usr/bin/env python3
"""
精确对比GoChat和Chatwoot的API路由覆盖情况。
从routes.rb手工提取Chatwoot完整路由列表,
与GoChat router.go的已注册路由做对比。
"""
# ============================================================
# Chatwoot完整路由列表 (从routes.rb手工提取)
# 格式: (HTTP方法, 路径, 对应controller#action)
# ============================================================
# --- /api/v1 (非account-scoped) ---
CHATWOOT_V1_NON_ACCOUNT = [
# Auth (devise_token_auth)
("POST", "/auth", "auth#create (login)"),
("DELETE", "/auth", "auth#destroy (logout)"),
("POST", "/auth/sign_in", "sessions#create"),
("DELETE", "/auth/sign_out", "sessions#destroy"),
("POST", "/auth/password", "passwords#create"),
("PUT", "/auth/password", "passwords#update"),
("POST", "/auth/password/reset", "passwords#reset"),
("POST", "/resend_confirmation", "resend_confirmations#create"),
# Profile
("GET", "/api/v1/profile", "profile#show"),
("PUT", "/api/v1/profile", "profile#update"),
("DELETE", "/api/v1/profile/avatar", "profile#delete_avatar"),
("POST", "/api/v1/profile/availability", "profile#availability"),
("POST", "/api/v1/profile/auto_offline", "profile#auto_offline"),
("PUT", "/api/v1/profile/set_active_account", "profile#set_active_account"),
("POST", "/api/v1/profile/resend_confirmation", "profile#resend_confirmation"),
("POST", "/api/v1/profile/reset_access_token", "profile#reset_access_token"),
# MFA
("GET", "/api/v1/profile/mfa", "mfa#show"),
("POST", "/api/v1/profile/mfa", "mfa#create"),
("DELETE", "/api/v1/profile/mfa", "mfa#destroy"),
("POST", "/api/v1/profile/mfa/verify", "mfa#verify"),
("POST", "/api/v1/profile/mfa/backup_codes", "mfa#backup_codes"),
# Notification subscriptions
("POST", "/api/v1/notification_subscriptions", "notification_subscriptions#create"),
("DELETE", "/api/v1/notification_subscriptions", "notification_subscriptions#destroy"),
# SAML login
("POST", "/api/v1/auth/saml_login", "auth#saml_login"),
]
# --- /api/v1/accounts/:account_id (account-scoped) ---
CHATWOOT_ACCOUNT_SCOPED = [
# Accounts
("POST", "/api/v1/accounts", "accounts#create"),
("GET", "/api/v1/accounts/:account_id", "accounts#show"),
("PUT", "/api/v1/accounts/:account_id", "accounts#update"),
("POST", "/api/v1/accounts/:account_id/update_active_at", "accounts#update_active_at"),
("GET", "/api/v1/accounts/:account_id/cache_keys", "accounts#cache_keys"),
("PUT", "/api/v1/accounts/:account_id/settings", "accounts#update_settings"),
# Actions - contact_merge
("POST", "/api/v1/accounts/:account_id/actions/contact_merge", "contact_merges#create"),
# Bulk actions
("POST", "/api/v1/accounts/:account_id/bulk_actions", "bulk_actions#create"),
# Agents
("GET", "/api/v1/accounts/:account_id/agents", "agents#index"),
("POST", "/api/v1/accounts/:account_id/agents", "agents#create"),
("PUT", "/api/v1/accounts/:account_id/agents/:id", "agents#update"),
("DELETE", "/api/v1/accounts/:account_id/agents/:id", "agents#destroy"),
("POST", "/api/v1/accounts/:account_id/agents/bulk_create", "agents#bulk_create"),
# Assignable agents
("GET", "/api/v1/accounts/:account_id/assignable_agents", "assignable_agents#index"),
# Agent bots
("GET", "/api/v1/accounts/:account_id/agent_bots", "agent_bots#index"),
("POST", "/api/v1/accounts/:account_id/agent_bots", "agent_bots#create"),
("GET", "/api/v1/accounts/:account_id/agent_bots/:id", "agent_bots#show"),
("PUT", "/api/v1/accounts/:account_id/agent_bots/:id", "agent_bots#update"),
("DELETE", "/api/v1/accounts/:account_id/agent_bots/:id", "agent_bots#destroy"),
("DELETE", "/api/v1/accounts/:account_id/agent_bots/:id/avatar", "agent_bots#delete_avatar"),
("POST", "/api/v1/accounts/:account_id/agent_bots/:id/reset_access_token", "agent_bots#reset_access_token"),
("POST", "/api/v1/accounts/:account_id/agent_bots/:id/reset_secret", "agent_bots#reset_secret"),
# Automation rules
("GET", "/api/v1/accounts/:account_id/automation_rules", "automation_rules#index"),
("POST", "/api/v1/accounts/:account_id/automation_rules", "automation_rules#create"),
("GET", "/api/v1/accounts/:account_id/automation_rules/:id", "automation_rules#show"),
("PUT", "/api/v1/accounts/:account_id/automation_rules/:id", "automation_rules#update"),
("DELETE", "/api/v1/accounts/:account_id/automation_rules/:id", "automation_rules#destroy"),
("POST", "/api/v1/accounts/:account_id/automation_rules/:id/clone", "automation_rules#clone"),
# Canned responses
("GET", "/api/v1/accounts/:account_id/canned_responses", "canned_responses#index"),
("POST", "/api/v1/accounts/:account_id/canned_responses", "canned_responses#create"),
("PUT", "/api/v1/accounts/:account_id/canned_responses/:id", "canned_responses#update"),
("DELETE", "/api/v1/accounts/:account_id/canned_responses/:id", "canned_responses#destroy"),
# Captain - preferences
("GET", "/api/v1/accounts/:account_id/captain/preferences", "captain/preferences#show"),
("PUT", "/api/v1/accounts/:account_id/captain/preferences", "captain/preferences#update"),
# Captain - assistants
("GET", "/api/v1/accounts/:account_id/captain/assistants", "captain/assistants#index"),
("POST", "/api/v1/accounts/:account_id/captain/assistants", "captain/assistants#create"),
("GET", "/api/v1/accounts/:account_id/captain/assistants/:id", "captain/assistants#show"),
("PUT", "/api/v1/accounts/:account_id/captain/assistants/:id", "captain/assistants#update"),
("DELETE", "/api/v1/accounts/:account_id/captain/assistants/:id", "captain/assistants#destroy"),
("POST", "/api/v1/accounts/:account_id/captain/assistants/:id/playground", "captain/assistants#playground"),
("GET", "/api/v1/accounts/:account_id/captain/assistants/tools", "captain/assistants#tools"),
# Captain - assistant inboxes
("GET", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/inboxes", "captain/assistants/inboxes#index"),
("POST", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/inboxes", "captain/assistants/inboxes#create"),
("DELETE", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/inboxes/:inbox_id", "captain/assistants/inboxes#destroy"),
# Captain - scenarios
("GET", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/scenarios", "captain/scenarios#index"),
("POST", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/scenarios", "captain/scenarios#create"),
("GET", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/scenarios/:id", "captain/scenarios#show"),
("PUT", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/scenarios/:id", "captain/scenarios#update"),
("DELETE", "/api/v1/accounts/:account_id/captain/assistants/:assistant_id/scenarios/:id", "captain/scenarios#destroy"),
# Captain - assistant_responses
("GET", "/api/v1/accounts/:account_id/captain/assistant_responses", "captain/assistant_responses#index"),
# Captain - bulk_actions
("POST", "/api/v1/accounts/:account_id/captain/bulk_actions", "captain/bulk_actions#create"),
# Captain - copilot_threads/messages
("GET", "/api/v1/accounts/:account_id/captain/copilot_threads", "captain/copilot_threads#index"),
("POST", "/api/v1/accounts/:account_id/captain/copilot_threads", "captain/copilot_threads#create"),
("GET", "/api/v1/accounts/:account_id/captain/copilot_threads/:id/copilot_messages", "captain/copilot_messages#index"),
("POST", "/api/v1/accounts/:account_id/captain/copilot_threads/:id/copilot_messages", "captain/copilot_messages#create"),
# Captain - custom_tools
("GET", "/api/v1/accounts/:account_id/captain/custom_tools", "captain/custom_tools#index"),
("POST", "/api/v1/accounts/:account_id/captain/custom_tools", "captain/custom_tools#create"),
("GET", "/api/v1/accounts/:account_id/captain/custom_tools/:id", "captain/custom_tools#show"),
("PUT", "/api/v1/accounts/:account_id/captain/custom_tools/:id", "captain/custom_tools#update"),
("DELETE", "/api/v1/accounts/:account_id/captain/custom_tools/:id", "captain/custom_tools#destroy"),
("POST", "/api/v1/accounts/:account_id/captain/custom_tools/test", "captain/custom_tools#test"),
# Captain - documents
("GET", "/api/v1/accounts/:account_id/captain/documents", "captain/documents#index"),
("POST", "/api/v1/accounts/:account_id/captain/documents", "captain/documents#create"),
("GET", "/api/v1/accounts/:account_id/captain/documents/:id", "captain/documents#show"),
("DELETE", "/api/v1/accounts/:account_id/captain/documents/:id", "captain/documents#destroy"),
("POST", "/api/v1/accounts/:account_id/captain/documents/:id/sync", "captain/documents#sync"),
# Captain - tasks (rewrite)
("POST", "/api/v1/accounts/:account_id/captain/tasks/rewrite", "captain/tasks#rewrite"),
# Callbacks
("POST", "/api/v1/accounts/:account_id/callbacks/register_facebook_page", "callbacks#register_facebook_page"),
("POST", "/api/v1/accounts/:account_id/callbacks/verify_facebook_page", "callbacks#verify_facebook_page"),
# Campaigns
("GET", "/api/v1/accounts/:account_id/campaigns", "campaigns#index"),
("POST", "/api/v1/accounts/:account_id/campaigns", "campaigns#create"),
("GET", "/api/v1/accounts/:account_id/campaigns/:id", "campaigns#show"),
("PUT", "/api/v1/accounts/:account_id/campaigns/:id", "campaigns#update"),
("DELETE", "/api/v1/accounts/:account_id/campaigns/:id", "campaigns#destroy"),
# Contact inboxes (filter)
("GET", "/api/v1/accounts/:account_id/contact_inboxes/filter", "contact_inboxes#filter"),
# Conversations
("GET", "/api/v1/accounts/:account_id/conversations", "conversations#index"),
("POST", "/api/v1/accounts/:account_id/conversations", "conversations#create"),
("GET", "/api/v1/accounts/:account_id/conversations/search", "conversations#search"),
("POST", "/api/v1/accounts/:account_id/conversations/filter", "conversations#filter"),
("GET", "/api/v1/accounts/:account_id/conversations/meta", "conversations#meta"),
("GET", "/api/v1/accounts/:account_id/conversations/unread_counts", "conversations/unread_counts#index"),
("GET", "/api/v1/accounts/:account_id/conversations/:id", "conversations#show"),
("PATCH", "/api/v1/accounts/:account_id/conversations/:id", "conversations#update"),
("DELETE", "/api/v1/accounts/:account_id/conversations/:id", "conversations#destroy"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/mute", "conversations#mute"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/unmute", "conversations#unmute"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/transcript", "conversations#transcript"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/toggle_status", "conversations#toggle_status"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/toggle_priority", "conversations#toggle_priority"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/toggle_typing_status", "conversations#toggle_typing_status"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/update_last_seen", "conversations#update_last_seen"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/unread", "conversations#unread"),
("POST", "/api/v1/accounts/:account_id/conversations/:id/custom_attributes", "conversations#custom_attributes"),
("GET", "/api/v1/accounts/:account_id/conversations/:id/attachments", "conversations#attachments"),
# Conversation messages (nested)
("GET", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages", "conversations/messages#index"),
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages", "conversations/messages#create"),
("PATCH", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages/:id", "conversations/messages#update"),
("DELETE", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages/:id", "conversations/messages#destroy"),
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages/:id/translate", "conversations/messages#translate"),
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/messages/:id/retry", "conversations/messages#retry"),
# Conversation assignments
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/assignments", "conversations/assignments#create"),
# Conversation labels
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/labels", "conversations/labels#create"),
("GET", "/api/v1/accounts/:account_id/conversations/:conversation_id/labels", "conversations/labels#index"),
# Conversation participants
("GET", "/api/v1/accounts/:account_id/conversations/:conversation_id/participants", "conversations/participants#show"),
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/participants", "conversations/participants#create"),
("PATCH", "/api/v1/accounts/:account_id/conversations/:conversation_id/participants", "conversations/participants#update"),
("DELETE", "/api/v1/accounts/:account_id/conversations/:conversation_id/participants", "conversations/participants#destroy"),
# Conversation direct_uploads
("POST", "/api/v1/accounts/:account_id/conversations/:conversation_id/direct_uploads", "conversations/direct_uploads#create"),
# Conversation draft_messages
("GET", "/api/v1/accounts/:account_id/conversations/:conversation_id/draft_messages", "conversations/draft_messages#show"),
("PATCH", "/api/v1/accounts/:account_id/conversations/:conversation_id/draft_messages", "conversations/draft_messages#update"),
("DELETE", "/api/v1/accounts/:account_id/conversations/:conversation_id/draft_messages", "conversations/draft_messages#destroy"),
# CSAT survey responses
("GET", "/api/v1/accounts/:account_id/csat_survey_responses", "csat_survey_responses#index"),
("GET", "/api/v1/accounts/:account_id/csat_survey_responses/metrics", "csat_survey_responses#metrics"),
("GET", "/api/v1/accounts/:account_id/csat_survey_responses/download", "csat_survey_responses#download"),
# Applied SLAs
("GET", "/api/v1/accounts/:account_id/applied_slas", "applied_slas#index"),
("GET", "/api/v1/accounts/:account_id/applied_slas/metrics", "applied_slas#metrics"),
("GET", "/api/v1/accounts/:account_id/applied_slas/download", "applied_slas#download"),
# Reporting events
("GET", "/api/v1/accounts/:account_id/reporting_events", "reporting_events#index"),
# WhatsApp calls (enterprise)
("GET", "/api/v1/accounts/:account_id/whatsapp_calls/:id", "whatsapp_calls#show"),
("POST", "/api/v1/accounts/:account_id/whatsapp_calls/:id/accept", "whatsapp_calls#accept"),
("POST", "/api/v1/accounts/:account_id/whatsapp_calls/:id/reject", "whatsapp_calls#reject"),
("POST", "/api/v1/accounts/:account_id/whatsapp_calls/:id/terminate", "whatsapp_calls#terminate"),
("POST", "/api/v1/accounts/:account_id/whatsapp_calls/:id/upload_recording", "whatsapp_calls#upload_recording"),
("POST", "/api/v1/accounts/:account_id/whatsapp_calls/initiate", "whatsapp_calls#initiate"),
# Custom attribute definitions
("GET", "/api/v1/accounts/:account_id/custom_attribute_definitions", "custom_attribute_definitions#index"),
("POST", "/api/v1/accounts/:account_id/custom_attribute_definitions", "custom_attribute_definitions#create"),
("GET", "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", "custom_attribute_definitions#show"),
("PUT", "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", "custom_attribute_definitions#update"),
("DELETE", "/api/v1/accounts/:account_id/custom_attribute_definitions/:id", "custom_attribute_definitions#destroy"),
# Custom filters
("GET", "/api/v1/accounts/:account_id/custom_filters", "custom_filters#index"),
("POST", "/api/v1/accounts/:account_id/custom_filters", "custom_filters#create"),
("GET", "/api/v1/accounts/:account_id/custom_filters/:id", "custom_filters#show"),
("PUT", "/api/v1/accounts/:account_id/custom_filters/:id", "custom_filters#update"),
("DELETE", "/api/v1/accounts/:account_id/custom_filters/:id", "custom_filters#destroy"),
# Inboxes
("GET", "/api/v1/accounts/:account_id/inboxes", "inboxes#index"),
("POST", "/api/v1/accounts/:account_id/inboxes", "inboxes#create"),
("GET", "/api/v1/accounts/:account_id/inboxes/:id", "inboxes#show"),
("PUT", "/api/v1/accounts/:account_id/inboxes/:id", "inboxes#update"),
("DELETE", "/api/v1/accounts/:account_id/inboxes/:id", "inboxes#destroy"),
("GET", "/api/v1/accounts/:account_id/inboxes/:id/assignable_agents", "inboxes#assignable_agents"),
("GET", "/api/v1/accounts/:account_id/inboxes/:id/campaigns", "inboxes#campaigns"),
("GET", "/api/v1/accounts/:account_id/inboxes/:id/agent_bot", "inboxes#agent_bot"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/set_agent_bot", "inboxes#set_agent_bot"),
("DELETE", "/api/v1/accounts/:account_id/inboxes/:id/avatar", "inboxes#delete_avatar"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/sync_templates", "inboxes#sync_templates"),
("GET", "/api/v1/accounts/:account_id/inboxes/:id/health", "inboxes#health"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/register_webhook", "inboxes#register_webhook"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/reset_secret", "inboxes#reset_secret"),
# Inbox CSAT template
("GET", "/api/v1/accounts/:account_id/inboxes/:id/csat_template", "inbox_csat_templates#show"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/csat_template", "inbox_csat_templates#create"),
("POST", "/api/v1/accounts/:account_id/inboxes/:id/csat_template/analyze", "inbox_csat_templates#analyze"),
# Inbox assignment_policy
("GET", "/api/v1/accounts/:account_id/inboxes/:inbox_id/assignment_policy", "inboxes/assignment_policy#show"),
("POST", "/api/v1/accounts/:account_id/inboxes/:inbox_id/assignment_policy", "inboxes/assignment_policy#create"),
("DELETE", "/api/v1/accounts/:account_id/inboxes/:inbox_id/assignment_policy", "inboxes/assignment_policy#destroy"),
# Inbox members
("POST", "/api/v1/accounts/:account_id/inbox_members", "inbox_members#create"),
("GET", "/api/v1/accounts/:account_id/inbox_members/:inbox_id", "inbox_members#show"),
("DELETE", "/api/v1/accounts/:account_id/inbox_members", "inbox_members#destroy"),
("PATCH", "/api/v1/accounts/:account_id/inbox_members", "inbox_members#update"),
# Labels
("GET", "/api/v1/accounts/:account_id/labels", "labels#index"),
("POST", "/api/v1/accounts/:account_id/labels", "labels#create"),
("GET", "/api/v1/accounts/:account_id/labels/:id", "labels#show"),
("PUT", "/api/v1/accounts/:account_id/labels/:id", "labels#update"),
("DELETE", "/api/v1/accounts/:account_id/labels/:id", "labels#destroy"),
# Notifications
("GET", "/api/v1/accounts/:account_id/notifications", "notifications#index"),
("PUT", "/api/v1/accounts/:account_id/notifications/:id", "notifications#update"),
("DELETE", "/api/v1/accounts/:account_id/notifications/:id", "notifications#destroy"),
("POST", "/api/v1/accounts/:account_id/notifications/read_all", "notifications#read_all"),
("GET", "/api/v1/accounts/:account_id/notifications/unread_count", "notifications#unread_count"),
("POST", "/api/v1/accounts/:account_id/notifications/destroy_all", "notifications#destroy_all"),
("POST", "/api/v1/accounts/:account_id/notifications/:id/snooze", "notifications#snooze"),
("POST", "/api/v1/accounts/:account_id/notifications/:id/unread", "notifications#unread"),
# Notification settings
("GET", "/api/v1/accounts/:account_id/notification_settings", "notification_settings#show"),
("PUT", "/api/v1/accounts/:account_id/notification_settings", "notification_settings#update"),
# Teams
("GET", "/api/v1/accounts/:account_id/teams", "teams#index"),
("POST", "/api/v1/accounts/:account_id/teams", "teams#create"),
("GET", "/api/v1/accounts/:account_id/teams/:id", "teams#show"),
("PUT", "/api/v1/accounts/:account_id/teams/:id", "teams#update"),
("DELETE", "/api/v1/accounts/:account_id/teams/:id", "teams#destroy"),
# Team members
("GET", "/api/v1/accounts/:account_id/teams/:team_id/team_members", "team_members#index"),
("POST", "/api/v1/accounts/:account_id/teams/:team_id/team_members", "team_members#create"),
("DELETE", "/api/v1/accounts/:account_id/teams/:team_id/team_members", "team_members#destroy"),
("PATCH", "/api/v1/accounts/:account_id/teams/:team_id/team_members", "team_members#update"),
# Assignment policies
("GET", "/api/v1/accounts/:account_id/assignment_policies", "assignment_policies#index"),
("POST", "/api/v1/accounts/:account_id/assignment_policies", "assignment_policies#create"),
("GET", "/api/v1/accounts/:account_id/assignment_policies/:id", "assignment_policies#show"),
("PUT", "/api/v1/accounts/:account_id/assignment_policies/:id", "assignment_policies#update"),
("DELETE", "/api/v1/accounts/:account_id/assignment_policies/:id", "assignment_policies#destroy"),
("GET", "/api/v1/accounts/:account_id/assignment_policies/:assignment_policy_id/inboxes", "assignment_policies/inboxes#index"),
("POST", "/api/v1/accounts/:account_id/assignment_policies/:assignment_policy_id/inboxes", "assignment_policies/inboxes#create"),
("DELETE", "/api/v1/accounts/:account_id/assignment_policies/:assignment_policy_id/inboxes/:inbox_id", "assignment_policies/inboxes#destroy"),
# SLA policies
("GET", "/api/v1/accounts/:account_id/sla_policies", "sla_policies#index"),
("POST", "/api/v1/accounts/:account_id/sla_policies", "sla_policies#create"),
("GET", "/api/v1/accounts/:account_id/sla_policies/:id", "sla_policies#show"),
("PUT", "/api/v1/accounts/:account_id/sla_policies/:id", "sla_policies#update"),
("DELETE", "/api/v1/accounts/:account_id/sla_policies/:id", "sla_policies#destroy"),
# Custom roles
("GET", "/api/v1/accounts/:account_id/custom_roles", "custom_roles#index"),
("POST", "/api/v1/accounts/:account_id/custom_roles", "custom_roles#create"),
("GET", "/api/v1/accounts/:account_id/custom_roles/:id", "custom_roles#show"),
("PUT", "/api/v1/accounts/:account_id/custom_roles/:id", "custom_roles#update"),
("DELETE", "/api/v1/accounts/:account_id/custom_roles/:id", "custom_roles#destroy"),
# Agent capacity policies
("GET", "/api/v1/accounts/:account_id/agent_capacity_policies", "agent_capacity_policies#index"),
("POST", "/api/v1/accounts/:account_id/agent_capacity_policies", "agent_capacity_policies#create"),
("GET", "/api/v1/accounts/:account_id/agent_capacity_policies/:id", "agent_capacity_policies#show"),
("PUT", "/api/v1/accounts/:account_id/agent_capacity_policies/:id", "agent_capacity_policies#update"),
("DELETE", "/api/v1/accounts/:account_id/agent_capacity_policies/:id", "agent_capacity_policies#destroy"),
# Inbox limits
("GET", "/api/v1/accounts/:account_id/inbox_limits", "inbox_limits#index"),
("POST", "/api/v1/accounts/:account_id/inbox_limits", "inbox_limits#create"),
("GET", "/api/v1/accounts/:account_id/inbox_limits/:id", "inbox_limits#show"),
("PUT", "/api/v1/accounts/:account_id/inbox_limits/:id", "inbox_limits#update"),
("DELETE", "/api/v1/accounts/:account_id/inbox_limits/:id", "inbox_limits#destroy"),
# Macros
("GET", "/api/v1/accounts/:account_id/macros", "macros#index"),
("POST", "/api/v1/accounts/:account_id/macros", "macros#create"),
("GET", "/api/v1/accounts/:account_id/macros/:id", "macros#show"),
("PUT", "/api/v1/accounts/:account_id/macros/:id", "macros#update"),
("DELETE", "/api/v1/accounts/:account_id/macros/:id", "macros#destroy"),
("POST", "/api/v1/accounts/:account_id/macros/:id/execute", "macros#execute"),
# Dashboard apps
("GET", "/api/v1/accounts/:account_id/dashboard_apps", "dashboard_apps#index"),
("POST", "/api/v1/accounts/:account_id/dashboard_apps", "dashboard_apps#create"),
("GET", "/api/v1/accounts/:account_id/dashboard_apps/:id", "dashboard_apps#show"),
("PUT", "/api/v1/accounts/:account_id/dashboard_apps/:id", "dashboard_apps#update"),
("DELETE", "/api/v1/accounts/:account_id/dashboard_apps/:id", "dashboard_apps#destroy"),
# Search
("GET", "/api/v1/accounts/:account_id/search", "search#index"),
("GET", "/api/v1/accounts/:account_id/search/conversations", "search#conversations"),
("GET", "/api/v1/accounts/:account_id/search/messages", "search#messages"),
("GET", "/api/v1/accounts/:account_id/search/contacts", "search#contacts"),
# Companies
("GET", "/api/v1/accounts/:account_id/companies", "companies#index"),
("POST", "/api/v1/accounts/:account_id/companies", "companies#create"),
("GET", "/api/v1/accounts/:account_id/companies/search", "companies#search"),
("GET", "/api/v1/accounts/:account_id/companies/:id", "companies#show"),
("PUT", "/api/v1/accounts/:account_id/companies/:id", "companies#update"),
("DELETE", "/api/v1/accounts/:account_id/companies/:id", "companies#destroy"),
("POST", "/api/v1/accounts/:account_id/companies/:id/destroy_custom_attributes", "companies#destroy_custom_attributes"),
("DELETE", "/api/v1/accounts/:account_id/companies/:id/avatar", "companies#delete_avatar"),
("GET", "/api/v1/accounts/:account_id/companies/:id/contacts", "companies/contacts#index"),
("POST", "/api/v1/accounts/:account_id/companies/:id/contacts", "companies/contacts#create"),
("DELETE", "/api/v1/accounts/:account_id/companies/:id/contacts/:contact_id", "companies/contacts#destroy"),
("GET", "/api/v1/accounts/:account_id/companies/:id/contacts/search", "companies/contacts#search"),
("GET", "/api/v1/accounts/:account_id/companies/:id/conversations", "companies/conversations#index"),
("GET", "/api/v1/accounts/:account_id/companies/:id/notes", "companies/notes#index"),
# Contacts
("GET", "/api/v1/accounts/:account_id/contacts", "contacts#index"),
("POST", "/api/v1/accounts/:account_id/contacts", "contacts#create"),
("GET", "/api/v1/accounts/:account_id/contacts/active", "contacts#active"),
("GET", "/api/v1/accounts/:account_id/contacts/search", "contacts#search"),
("POST", "/api/v1/accounts/:account_id/contacts/filter", "contacts#filter"),
("POST", "/api/v1/accounts/:account_id/contacts/import", "contacts#import"),
("POST", "/api/v1/accounts/:account_id/contacts/export", "contacts#export"),
("GET", "/api/v1/accounts/:account_id/contacts/:id", "contacts#show"),
("PUT", "/api/v1/accounts/:account_id/contacts/:id", "contacts#update"),
("DELETE", "/api/v1/accounts/:account_id/contacts/:id", "contacts#destroy"),
("GET", "/api/v1/accounts/:account_id/contacts/:id/contactable_inboxes", "contacts#contactable_inboxes"),
("POST", "/api/v1/accounts/:account_id/contacts/:id/destroy_custom_attributes", "contacts#destroy_custom_attributes"),
("DELETE", "/api/v1/accounts/:account_id/contacts/:id/avatar", "contacts#delete_avatar"),
# Contact nested resources
("GET", "/api/v1/accounts/:account_id/contacts/:id/conversations", "contacts/conversations#index"),
("POST", "/api/v1/accounts/:account_id/contacts/:id/contact_inboxes", "contacts/contact_inboxes#create"),
("GET", "/api/v1/accounts/:account_id/contacts/:id/labels", "contacts/labels#index"),
("POST", "/api/v1/accounts/:account_id/contacts/:id/labels", "contacts/labels#create"),
("GET", "/api/v1/accounts/:account_id/contacts/:id/notes", "contacts/notes#index"),
("POST", "/api/v1/accounts/:account_id/contacts/:id/notes", "contacts/notes#create"),
("GET", "/api/v1/accounts/:account_id/contacts/:id/notes/:note_id", "contacts/notes#show"),
("PATCH", "/api/v1/accounts/:account_id/contacts/:id/notes/:note_id", "contacts/notes#update"),
("DELETE", "/api/v1/accounts/:account_id/contacts/:id/notes/:note_id", "contacts/notes#destroy"),
("GET", "/api/v1/accounts/:account_id/contacts/:id/attachments", "contacts/attachments#index"),
# Twitter authorization
("POST", "/api/v1/accounts/:account_id/twitter/authorization", "twitter/authorization#create"),
# Microsoft authorization
("POST", "/api/v1/accounts/:account_id/microsoft/authorization", "microsoft/authorization#create"),
# Google authorization + webhooks
("POST", "/api/v1/accounts/:account_id/google/authorization", "google/authorization#create"),
("GET", "/api/v1/accounts/:account_id/google/oauth", "google_channels#authorization"),
("GET", "/api/v1/accounts/:account_id/google/callback", "google_channels#oauth_callback"),
("POST", "/api/v1/accounts/:account_id/google/webhooks", "google_channels#register_webhook"),
("GET", "/api/v1/accounts/:account_id/google/webhooks", "google_channels#list_webhooks"),
# Instagram authorization + comments
("POST", "/api/v1/accounts/:account_id/instagram/authorization", "instagram/authorization#create"),
("GET", "/api/v1/accounts/:account_id/inboxes/:inbox_id/instagram_comments/media/:media_id", "instagram_channel#get_comments"),
("GET", "/api/v1/accounts/:account_id/inboxes/:inbox_id/instagram_comments/:comment_id/replies", "instagram_channel#get_comment_replies"),
("POST", "/api/v1/accounts/:account_id/inboxes/:inbox_id/instagram_comments/:comment_id/reply", "instagram_channel#reply_to_comment"),
("POST", "/api/v1/accounts/:account_id/inboxes/:inbox_id/instagram_comments/:comment_id/hide", "instagram_channel#hide_comment"),
("DELETE", "/api/v1/accounts/:account_id/inboxes/:inbox_id/instagram_comments/:comment_id", "instagram_channel#delete_comment"),
# TikTok authorization
("POST", "/api/v1/accounts/:account_id/tiktok/authorization", "tiktok/authorization#create"),
# Notion authorization
("POST", "/api/v1/accounts/:account_id/notion/authorization", "notion/authorization#create"),
# WhatsApp authorization
("POST", "/api/v1/accounts/:account_id/whatsapp/authorization", "whatsapp/authorization#create"),
# Webhooks (account-level)
("GET", "/api/v1/accounts/:account_id/webhooks", "webhooks#index"),
("POST", "/api/v1/accounts/:account_id/webhooks", "webhooks#create"),
("PUT", "/api/v1/accounts/:account_id/webhooks/:id", "webhooks#update"),
("DELETE", "/api/v1/accounts/:account_id/webhooks/:id", "webhooks#destroy"),
# Integrations
("GET", "/api/v1/accounts/:account_id/integrations/apps", "integrations/apps#index"),
("GET", "/api/v1/accounts/:account_id/integrations/apps/:id", "integrations/apps#show"),
("GET", "/api/v1/accounts/:account_id/integrations/hooks/:id", "integrations/hooks#show"),
("POST", "/api/v1/accounts/:account_id/integrations/hooks", "integrations/hooks#create"),
("PUT", "/api/v1/accounts/:account_id/integrations/hooks/:id", "integrations/hooks#update"),
("DELETE", "/api/v1/accounts/:account_id/integrations/hooks/:id", "integrations/hooks#destroy"),
("POST", "/api/v1/accounts/:account_id/integrations/hooks/:id/process_event", "integrations/hooks#process_event"),
("POST", "/api/v1/accounts/:account_id/integrations/slack", "integrations/slack#create"),
("PUT", "/api/v1/accounts/:account_id/integrations/slack", "integrations/slack#update"),
("DELETE", "/api/v1/accounts/:account_id/integrations/slack", "integrations/slack#destroy"),
("GET", "/api/v1/accounts/:account_id/integrations/slack/list_all_channels", "integrations/slack#list_all_channels"),
("POST", "/api/v1/accounts/:account_id/integrations/dyte/create_a_meeting", "integrations/dyte#create_a_meeting"),
("POST", "/api/v1/accounts/:account_id/integrations/dyte/add_participant_to_meeting", "integrations/dyte#add_participant_to_meeting"),
("DELETE", "/api/v1/accounts/:account_id/integrations/shopify", "integrations/shopify#destroy"),
("POST", "/api/v1/accounts/:account_id/integrations/shopify/auth", "integrations/shopify#auth"),
("GET", "/api/v1/accounts/:account_id/integrations/shopify/orders", "integrations/shopify#orders"),
("DELETE", "/api/v1/accounts/:account_id/integrations/linear", "integrations/linear#destroy"),
("GET", "/api/v1/accounts/:account_id/integrations/linear/teams", "integrations/linear#teams"),
("GET", "/api/v1/accounts/:account_id/integrations/linear/team_entities", "integrations/linear#team_entities"),
("POST", "/api/v1/accounts/:account_id/integrations/linear/create_issue", "integrations/linear#create_issue"),
("POST", "/api/v1/accounts/:account_id/integrations/linear/link_issue", "integrations/linear#link_issue"),
("POST", "/api/v1/accounts/:account_id/integrations/linear/unlink_issue", "integrations/linear#unlink_issue"),
("GET", "/api/v1/accounts/:account_id/integrations/linear/search_issue", "integrations/linear#search_issue"),
("GET", "/api/v1/accounts/:account_id/integrations/linear/linked_issues", "integrations/linear#linked_issues"),
("DELETE", "/api/v1/accounts/:account_id/integrations/notion", "integrations/notion#destroy"),
# Portals
("GET", "/api/v1/accounts/:account_id/portals", "portals#index"),
("POST", "/api/v1/accounts/:account_id/portals", "portals#create"),
("GET", "/api/v1/accounts/:account_id/portals/:id", "portals#show"),
("PUT", "/api/v1/accounts/:account_id/portals/:id", "portals#update"),
("DELETE", "/api/v1/accounts/:account_id/portals/:id", "portals#destroy"),
("PATCH", "/api/v1/accounts/:account_id/portals/:id/archive", "portals#archive"),
("DELETE", "/api/v1/accounts/:account_id/portals/:id/logo", "portals#delete_logo"),
("POST", "/api/v1/accounts/:account_id/portals/:id/send_instructions", "portals#send_instructions"),
("GET", "/api/v1/accounts/:account_id/portals/:id/ssl_status", "portals#ssl_status"),
# Portal categories
("GET", "/api/v1/accounts/:account_id/portals/:portal_id/categories", "categories#index"),
("POST", "/api/v1/accounts/:account_id/portals/:portal_id/categories", "categories#create"),
("GET", "/api/v1/accounts/:account_id/portals/:portal_id/categories/:id", "categories#show"),
("PUT", "/api/v1/accounts/:account_id/portals/:portal_id/categories/:id", "categories#update"),
("DELETE", "/api/v1/accounts/:account_id/portals/:portal_id/categories/:id", "categories#destroy"),
("POST", "/api/v1/accounts/:account_id/portals/:portal_id/categories/reorder", "categories#reorder"),
# Portal articles
("GET", "/api/v1/accounts/:account_id/portals/:portal_id/articles", "articles#index"),
("POST", "/api/v1/accounts/:account_id/portals/:portal_id/articles", "articles#create"),
("GET", "/api/v1/accounts/:account_id/portals/:portal_id/articles/:id", "articles#show"),
("PUT", "/api/v1/accounts/:account_id/portals/:portal_id/articles/:id", "articles#update"),
("DELETE", "/api/v1/accounts/:account_id/portals/:portal_id/articles/:id", "articles#destroy"),
("POST", "/api/v1/accounts/:account_id/portals/:portal_id/articles/reorder", "articles#reorder"),
# Portal article bulk actions
("POST", "/api/v1/accounts/:account_id/portals/articles/bulk_actions/translate", "articles/bulk_actions#translate"),
("PATCH", "/api/v1/accounts/:account_id/portals/articles/bulk_actions/update_status", "articles/bulk_actions#update_status"),
("DELETE", "/api/v1/accounts/:account_id/portals/articles/bulk_actions/delete_articles", "articles/bulk_actions#delete_articles"),
# Upload
("POST", "/api/v1/accounts/:account_id/upload", "upload#create"),
("POST", "/api/v1/accounts/:account_id/direct_uploads", "upload#direct_uploads"),
# Channel - Twilio
("POST", "/api/v1/accounts/:account_id/channels/twilio_channel", "twilio_channels#create"),
]
# --- /api/v2/accounts/:account_id (v2 reports) ---
CHATWOOT_V2 = [
("GET", "/api/v2/accounts/:account_id/summary_reports/agent", "summary_reports#agent"),
("GET", "/api/v2/accounts/:account_id/summary_reports/team", "summary_reports#team"),
("GET", "/api/v2/accounts/:account_id/summary_reports/inbox", "summary_reports#inbox"),
("GET", "/api/v2/accounts/:account_id/summary_reports/label", "summary_reports#label"),
("GET", "/api/v2/accounts/:account_id/summary_reports/channel", "summary_reports#channel"),
("GET", "/api/v2/accounts/:account_id/reports", "reports#index"),
("GET", "/api/v2/accounts/:account_id/reports/summary", "reports#summary"),
("GET", "/api/v2/accounts/:account_id/reports/bot_summary", "reports#bot_summary"),
("GET", "/api/v2/accounts/:account_id/reports/agents", "reports#agents"),
("GET", "/api/v2/accounts/:account_id/reports/inboxes", "reports#inboxes"),
("GET", "/api/v2/accounts/:account_id/reports/labels", "reports#labels"),
("GET", "/api/v2/accounts/:account_id/reports/teams", "reports#teams"),
("GET", "/api/v2/accounts/:account_id/reports/conversations", "reports#conversations"),
("GET", "/api/v2/accounts/:account_id/reports/conversations_summary", "reports#conversations_summary"),
("GET", "/api/v2/accounts/:account_id/reports/conversation_traffic", "reports#conversation_traffic"),
("GET", "/api/v2/accounts/:account_id/reports/bot_metrics", "reports#bot_metrics"),
("GET", "/api/v2/accounts/:account_id/reports/inbox_label_matrix", "reports#inbox_label_matrix"),
("GET", "/api/v2/accounts/:account_id/reports/first_response_time_distribution", "reports#first_response_time_distribution"),
("GET", "/api/v2/accounts/:account_id/reports/outgoing_messages_count", "reports#outgoing_messages_count"),
("GET", "/api/v2/accounts/:account_id/year_in_review", "year_in_review#show"),
("GET", "/api/v2/accounts/:account_id/live_reports/conversation_metrics", "live_reports#conversation_metrics"),
("GET", "/api/v2/accounts/:account_id/live_reports/grouped_conversation_metrics", "live_reports#grouped_conversation_metrics"),
]
# --- Integrations webhooks (non-account scoped) ---
CHATWOOT_INTEGRATIONS = [
("POST", "/api/v1/integrations/webhooks", "integrations/webhooks#create"),
]
# --- Widget routes ---
CHATWOOT_WIDGET = [
("POST", "/widget/direct_uploads", "widget/direct_uploads#create"),
("POST", "/widget/config", "widget/config#create"),
("GET", "/widget/campaigns", "widget/campaigns#index"),
("POST", "/widget/events", "widget/events#create"),
("GET", "/widget/messages", "widget/messages#index"),
("POST", "/widget/messages", "widget/messages#create"),
("PATCH", "/widget/messages", "widget/messages#update"),
("GET", "/widget/conversations", "widget/conversations#index"),
("POST", "/widget/conversations", "widget/conversations#create"),
("POST", "/widget/conversations/destroy_custom_attributes", "widget/conversations#destroy_custom_attributes"),
("POST", "/widget/conversations/set_custom_attributes", "widget/conversations#set_custom_attributes"),
("POST", "/widget/conversations/update_last_seen", "widget/conversations#update_last_seen"),
("POST", "/widget/conversations/toggle_typing", "widget/conversations#toggle_typing"),
("POST", "/widget/conversations/transcript", "widget/conversations#transcript"),
("GET", "/widget/conversations/toggle_status", "widget/conversations#toggle_status"),
("GET", "/widget/contact", "widget/contact#show"),
("PATCH", "/widget/contact", "widget/contact#update"),
("POST", "/widget/contact/destroy_custom_attributes", "widget/contact#destroy_custom_attributes"),
("PATCH", "/widget/contact/set_user", "widget/contact#set_user"),
("GET", "/widget/inbox_members", "widget/inbox_members#index"),
("POST", "/widget/labels", "widget/labels#create"),
("DELETE", "/widget/labels", "widget/labels#destroy"),
]
# --- Public API ---
CHATWOOT_PUBLIC = [
("GET", "/public/api/v1/inboxes", "public/inboxes#index"),
("POST", "/public/api/v1/contacts", "public/contacts#create"),
("GET", "/public/api/v1/contacts/:id", "public/contacts#show"),
("PATCH", "/public/api/v1/contacts/:id", "public/contacts#update"),
("GET", "/public/api/v1/conversations", "public/conversations#index"),
("POST", "/public/api/v1/conversations", "public/conversations#create"),
("GET", "/public/api/v1/conversations/:id", "public/conversations#show"),
("POST", "/public/api/v1/conversations/:id/toggle_status", "public/conversations#toggle_status"),
("POST", "/public/api/v1/conversations/:id/toggle_typing", "public/conversations#toggle_typing"),
("POST", "/public/api/v1/conversations/:id/update_last_seen", "public/conversations#update_last_seen"),
("GET", "/public/api/v1/conversations/:id/messages", "public/messages#index"),
("POST", "/public/api/v1/conversations/:id/messages", "public/messages#create"),
("PATCH", "/public/api/v1/conversations/:id/messages/:message_id", "public/messages#update"),
("GET", "/public/api/v1/csat_survey", "public/csat_survey#show"),
("PATCH", "/public/api/v1/csat_survey", "public/csat_survey#update"),
# Help Center public routes
("GET", "/hc/:slug", "public/portals#show"),
("GET", "/hc/:slug/sitemap.xml", "public/portals#sitemap"),
("GET", "/hc/:slug/:locale", "public/portals#show"),
("GET", "/hc/:slug/:locale/articles", "public/articles#index"),
("GET", "/hc/:slug/:locale/categories", "public/categories#index"),
("GET", "/hc/:slug/:locale/categories/:category_slug", "public/categories#show"),
("GET", "/hc/:slug/:locale/categories/:category_slug/articles", "public/articles#index"),
("GET", "/hc/:slug/articles/:article_slug", "public/articles#show"),
]
# --- Platform API ---
CHATWOOT_PLATFORM = [
("POST", "/platform/api/v1/users", "platform/users#create"),
("GET", "/platform/api/v1/users/:id", "platform/users#show"),
("PUT", "/platform/api/v1/users/:id", "platform/users#update"),
("DELETE", "/platform/api/v1/users/:id", "platform/users#destroy"),
("GET", "/platform/api/v1/users/:id/login", "platform/users#login"),
("POST", "/platform/api/v1/users/:id/token", "platform/users#token"),
("GET", "/platform/api/v1/agent_bots", "platform/agent_bots#index"),
("POST", "/platform/api/v1/agent_bots", "platform/agent_bots#create"),
("GET", "/platform/api/v1/agent_bots/:id", "platform/agent_bots#show"),
("PUT", "/platform/api/v1/agent_bots/:id", "platform/agent_bots#update"),
("DELETE", "/platform/api/v1/agent_bots/:id", "platform/agent_bots#destroy"),
("DELETE", "/platform/api/v1/agent_bots/:id/avatar", "platform/agent_bots#delete_avatar"),
("GET", "/platform/api/v1/accounts", "platform/accounts#index"),
("POST", "/platform/api/v1/accounts", "platform/accounts#create"),
("GET", "/platform/api/v1/accounts/:id", "platform/accounts#show"),
("PUT", "/platform/api/v1/accounts/:id", "platform/accounts#update"),
("DELETE", "/platform/api/v1/accounts/:id", "platform/accounts#destroy"),
("GET", "/platform/api/v1/accounts/:account_id/account_users", "platform/account_users#index"),
("POST", "/platform/api/v1/accounts/:account_id/account_users", "platform/account_users#create"),
("DELETE", "/platform/api/v1/accounts/:account_id/account_users", "platform/account_users#destroy"),
("POST", "/platform/api/v1/accounts/:account_id/email_channel_migrations", "platform/email_channel_migrations#create"),
]
# --- Enterprise API ---
CHATWOOT_ENTERPRISE = [
("POST", "/enterprise/api/v1/accounts/:id/checkout", "enterprise/accounts#checkout"),
("POST", "/enterprise/api/v1/accounts/:id/subscription", "enterprise/accounts#subscription"),
("GET", "/enterprise/api/v1/accounts/:id/limits", "enterprise/accounts#limits"),
("POST", "/enterprise/api/v1/accounts/:id/toggle_deletion", "enterprise/accounts#toggle_deletion"),
("POST", "/enterprise/api/v1/accounts/:id/topup_checkout", "enterprise/accounts#topup_checkout"),
("POST", "/webhooks/stripe", "enterprise/webhooks/stripe#process_payload"),
("POST", "/webhooks/firecrawl", "enterprise/webhooks/firecrawl#process_payload"),
]
# --- Webhook routes (incoming channels) ---
CHATWOOT_WEBHOOKS = [
("GET", "/webhooks/facebook/:page_id", "facebook_webhook#verify"),
("POST", "/webhooks/facebook/:page_id", "facebook_webhook#event"),
("POST", "/webhooks/telegram/:bot_token", "telegram_webhook#event"),
("GET", "/webhooks/whatsapp/:phone_number_id", "whatsapp_webhook#verify"),
("POST", "/webhooks/whatsapp/:phone_number_id", "whatsapp_webhook#event"),
("GET", "/webhooks/tiktok/:business_id", "tiktok_webhook#verify"),
("POST", "/webhooks/tiktok/:business_id", "tiktok_webhook#event"),
("POST", "/webhooks/line/:channel_id", "line_webhook#event"),
("POST", "/webhooks/twilio/sms/:phone_number", "twilio_webhook#inbound_sms"),
("POST", "/webhooks/twilio/status/:phone_number", "twilio_webhook#delivery_status"),
("GET", "/webhooks/twitter/webhook", "twitter_webhook#crc"),
("POST", "/webhooks/twitter/webhook", "twitter_webhook#event"),
("POST", "/webhooks/microsoft/validation", "microsoft_webhook#validation"),
("POST", "/webhooks/microsoft/events", "microsoft_webhook#event"),
("POST", "/webhooks/email/:inbox_id", "email_webhook#event"),
("GET", "/webhooks/email/:inbox_id/verification", "email_webhook#verification"),
]
# --- WebSocket ---
CHATWOOT_WS = [
("GET", "/ws", "websocket#serve"),
("GET", "/cable", "websocket#serve_cable"),
]
# --- Health check ---
CHATWOOT_HEALTH = [
("GET", "/health", "health#check"),
]
# 合计所有Chatwoot路由
ALL_CHATWOOT = (
CHATWOOT_V1_NON_ACCOUNT +
CHATWOOT_ACCOUNT_SCOPED +
CHATWOOT_V2 +
CHATWOOT_INTEGRATIONS +
CHATWOOT_WIDGET +
CHATWOOT_PUBLIC +
CHATWOOT_PLATFORM +
CHATWOOT_ENTERPRISE +
CHATWOOT_WEBHOOKS +
CHATWOOT_WS +
CHATWOOT_HEALTH
)
print(f"Chatwoot total routes: {len(ALL_CHATWOOT)}")