-
{{ $t('CAPTAIN.COPILOT.YOU') }}
-
- {{ message.content }}
-
+
+
{{ $t('CAPTAIN.COPILOT.YOU') }}
+
+ {{ message.content }}
diff --git a/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue b/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue
index 1877e1630..0a37600bf 100644
--- a/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue
+++ b/app/javascript/dashboard/components-next/copilot/CopilotAssistantMessage.vue
@@ -9,7 +9,6 @@ import { COPILOT_EVENTS } from 'dashboard/helper/AnalyticsHelper/events';
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
import Button from 'dashboard/components-next/button/Button.vue';
-import Avatar from '../avatar/Avatar.vue';
const props = defineProps({
message: {
@@ -46,33 +45,25 @@ const useCopilotResponse = () => {
-
-
+ {{ $t('CAPTAIN.NAME') }}
+
+ {{ $t('CAPTAIN.COPILOT.EMPTY_MESSAGE') }}
+
+
-
-
{{ $t('CAPTAIN.NAME') }}
-
- {{ $t('CAPTAIN.COPILOT.EMPTY_MESSAGE') }}
-
-
diff --git a/app/javascript/dashboard/components-next/copilot/CopilotHeader.story.vue b/app/javascript/dashboard/components-next/copilot/CopilotHeader.story.vue
new file mode 100644
index 000000000..78a345093
--- /dev/null
+++ b/app/javascript/dashboard/components-next/copilot/CopilotHeader.story.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/copilot/CopilotHeader.vue b/app/javascript/dashboard/components-next/copilot/CopilotHeader.vue
new file mode 100644
index 000000000..c7a8696f3
--- /dev/null
+++ b/app/javascript/dashboard/components-next/copilot/CopilotHeader.vue
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ {{ $t('CAPTAIN.COPILOT.TITLE') }}
+
+
+
+
+
+
+
+
diff --git a/app/javascript/dashboard/components-next/copilot/CopilotInput.vue b/app/javascript/dashboard/components-next/copilot/CopilotInput.vue
index bf14945b5..c8f1a0056 100644
--- a/app/javascript/dashboard/components-next/copilot/CopilotInput.vue
+++ b/app/javascript/dashboard/components-next/copilot/CopilotInput.vue
@@ -13,19 +13,16 @@ const sendMessage = () => {
-
-
+
+
+
+
+ )
+ end
+
+ def self.arcade(video_id)
+ %(
+
+
+
+ )
+ end
+end
diff --git a/lib/events/types.rb b/lib/events/types.rb
index ff7eaf778..dce6b8b32 100644
--- a/lib/events/types.rb
+++ b/lib/events/types.rb
@@ -54,4 +54,7 @@ module Events::Types
# agent events
AGENT_ADDED = 'agent.added'
AGENT_REMOVED = 'agent.removed'
+
+ # copilot events
+ COPILOT_MESSAGE_CREATED = 'copilot.message.created'
end
diff --git a/lib/global_config_service.rb b/lib/global_config_service.rb
index 8de1c50c9..0649c24af 100644
--- a/lib/global_config_service.rb
+++ b/lib/global_config_service.rb
@@ -1,6 +1,6 @@
class GlobalConfigService
def self.load(config_key, default_value)
- config = ENV.fetch(config_key) { GlobalConfig.get(config_key)[config_key] }
+ config = GlobalConfig.get(config_key)[config_key]
return config if config.present?
# To support migrating existing instance relying on env variables
diff --git a/lib/integrations/slack/hook_builder.rb b/lib/integrations/slack/hook_builder.rb
index 139ef3a5b..e9513df57 100644
--- a/lib/integrations/slack/hook_builder.rb
+++ b/lib/integrations/slack/hook_builder.rb
@@ -32,8 +32,8 @@ class Integrations::Slack::HookBuilder
def fetch_access_token
client = Slack::Web::Client.new
slack_access = client.oauth_v2_access(
- client_id: ENV.fetch('SLACK_CLIENT_ID', 'TEST_CLIENT_ID'),
- client_secret: ENV.fetch('SLACK_CLIENT_SECRET', 'TEST_CLIENT_SECRET'),
+ client_id: GlobalConfigService.load('SLACK_CLIENT_ID', 'TEST_CLIENT_ID'),
+ client_secret: GlobalConfigService.load('SLACK_CLIENT_SECRET', 'TEST_CLIENT_SECRET'),
code: params[:code],
redirect_uri: Integrations::App.slack_integration_url
)
diff --git a/lib/integrations/slack/send_on_slack_service.rb b/lib/integrations/slack/send_on_slack_service.rb
index e68dd81af..c37a152e8 100644
--- a/lib/integrations/slack/send_on_slack_service.rb
+++ b/lib/integrations/slack/send_on_slack_service.rb
@@ -153,12 +153,12 @@ class Integrations::Slack::SendOnSlackService < Base::SendOnChannelService
def sender_type(sender)
if sender.instance_of?(Contact)
'Contact'
- elsif message.message_type == 'template' && sender.nil?
- 'Bot'
+ elsif sender.instance_of?(User)
+ 'Agent'
elsif message.message_type == 'activity' && sender.nil?
'System'
else
- 'Agent'
+ 'Bot'
end
end
diff --git a/lib/linear.rb b/lib/linear.rb
index 9a998c34a..8bf967fc3 100644
--- a/lib/linear.rb
+++ b/lib/linear.rb
@@ -57,7 +57,8 @@ class Linear
assigneeId: params[:assignee_id],
priority: params[:priority],
labelIds: params[:label_ids],
- projectId: params[:project_id]
+ projectId: params[:project_id],
+ stateId: params[:state_id]
}.compact
mutation = Linear::Mutations.issue_create(variables)
response = post({ query: mutation })
diff --git a/lib/tasks/db_enhancements.rake b/lib/tasks/db_enhancements.rake
index d9cc22334..5fddb6cde 100644
--- a/lib/tasks/db_enhancements.rake
+++ b/lib/tasks/db_enhancements.rake
@@ -18,7 +18,7 @@ db_namespace = namespace :db do
ActiveRecord::Base.configurations.configs_for(env_name: Rails.env).each do |db_config|
ActiveRecord::Base.establish_connection(db_config.configuration_hash)
unless ActiveRecord::Base.connection.table_exists? 'ar_internal_metadata'
- db_namespace['load_config'].invoke if ActiveRecord::Base.schema_format == :ruby
+ db_namespace['load_config'].invoke if ActiveRecord.schema_format == :ruby
ActiveRecord::Tasks::DatabaseTasks.load_schema_current(:ruby, ENV.fetch('SCHEMA', nil))
db_namespace['seed'].invoke
end
diff --git a/lib/tasks/swagger.rake b/lib/tasks/swagger.rake
index ef48ce3eb..6bf5f5742 100644
--- a/lib/tasks/swagger.rake
+++ b/lib/tasks/swagger.rake
@@ -1,22 +1,156 @@
-namespace :swagger do
- desc 'build combined swagger.json file from all the fragmented definitions and paths inside swagger folder'
- task build: :environment do
- require 'json_refs'
+require 'json_refs'
+require 'fileutils'
+require 'pathname'
+require 'yaml'
+require 'json'
- base_path = Rails.root.join('swagger')
- Dir.chdir(base_path) do
- swagger_index = YAML.safe_load(File.open('index.yml'))
+module SwaggerTaskActions
+ def self.execute_build
+ swagger_dir = Rails.root.join('swagger')
+ # Paths relative to swagger_dir for use within Dir.chdir
+ index_yml_relative_path = 'index.yml'
+ swagger_json_relative_path = 'swagger.json'
+
+ Dir.chdir(swagger_dir) do
+ # Operations within this block are relative to swagger_dir
+ swagger_index_content = File.read(index_yml_relative_path)
+ swagger_index = YAML.safe_load(swagger_index_content)
final_build = JsonRefs.call(
swagger_index,
resolve_local_ref: false,
- resolve_file_ref: true,
+ resolve_file_ref: true, # Uses CWD (swagger_dir) for resolving file refs
logging: true
)
- File.write('swagger.json', JSON.pretty_generate(final_build))
+ File.write(swagger_json_relative_path, JSON.pretty_generate(final_build))
+
+ # For user messages, provide the absolute path
+ absolute_swagger_json_path = swagger_dir.join(swagger_json_relative_path)
puts 'Swagger build was successful.'
- puts "Generated #{base_path}/swagger.json"
+ puts "Generated #{absolute_swagger_json_path}"
puts 'Go to http://localhost:3000/swagger see the changes.'
+
+ # Trigger dependent task
+ Rake::Task['swagger:build_tag_groups'].invoke
+ end
+ end
+
+ def self.execute_build_tag_groups
+ base_swagger_path = Rails.root.join('swagger')
+ tag_groups_output_dir = base_swagger_path.join('tag_groups')
+ full_spec_path = base_swagger_path.join('swagger.json')
+ index_yml_path = base_swagger_path.join('index.yml')
+
+ full_spec = JSON.parse(File.read(full_spec_path))
+ swagger_index = YAML.safe_load(File.read(index_yml_path))
+ tag_groups = swagger_index['x-tagGroups']
+
+ FileUtils.mkdir_p(tag_groups_output_dir)
+
+ tag_groups.each do |tag_group|
+ _process_tag_group(tag_group, full_spec, tag_groups_output_dir)
+ end
+
+ puts 'Tag-specific swagger files generated successfully.'
+ end
+
+ def self.execute_build_for_docs
+ Rake::Task['swagger:build'].invoke # Ensure all swagger files are built first
+
+ developer_docs_public_path = Rails.root.join('developer-docs/public')
+ tag_groups_in_dev_docs_path = developer_docs_public_path.join('swagger/tag_groups')
+ source_tag_groups_path = Rails.root.join('swagger/tag_groups')
+
+ FileUtils.mkdir_p(tag_groups_in_dev_docs_path)
+ puts 'Creating symlinks for developer-docs...'
+
+ symlink_files = %w[platform_swagger.json application_swagger.json client_swagger.json other_swagger.json]
+ symlink_files.each do |file|
+ _create_symlink(source_tag_groups_path.join(file), tag_groups_in_dev_docs_path.join(file))
+ end
+
+ puts 'Symlinks created successfully.'
+ puts 'You can now run the Mintlify dev server to preview the documentation.'
+ end
+
+ # Private helper methods
+ class << self
+ private
+
+ def _process_tag_group(tag_group, full_spec, output_dir)
+ group_name = tag_group['name']
+ tags_in_current_group = tag_group['tags']
+
+ tag_spec = JSON.parse(JSON.generate(full_spec)) # Deep clone
+
+ tag_spec['paths'] = _filter_paths_for_tag_group(tag_spec['paths'], tags_in_current_group)
+ tag_spec['tags'] = _filter_tags_for_tag_group(tag_spec['tags'], tags_in_current_group)
+
+ output_filename = _determine_output_filename(group_name)
+ File.write(output_dir.join(output_filename), JSON.pretty_generate(tag_spec))
+ end
+
+ def _operation_has_matching_tags?(operation, tags_in_group)
+ return false unless operation.is_a?(Hash)
+
+ operation_tags = operation['tags']
+ return false unless operation_tags.is_a?(Array)
+
+ operation_tags.intersect?(tags_in_group)
+ end
+
+ def _filter_paths_for_tag_group(paths_spec, tags_in_group)
+ (paths_spec || {}).filter_map do |path, path_item|
+ next unless path_item.is_a?(Hash)
+
+ operations_with_group_tags = path_item.any? do |_method, operation|
+ _operation_has_matching_tags?(operation, tags_in_group)
+ end
+ [path, path_item] if operations_with_group_tags
+ end.to_h
+ end
+
+ def _filter_tags_for_tag_group(tags_spec, tags_in_group)
+ if tags_spec.is_a?(Array)
+ tags_spec.select { |tag_definition| tags_in_group.include?(tag_definition['name']) }
+ else
+ []
+ end
+ end
+
+ def _determine_output_filename(group_name)
+ return 'other_swagger.json' if group_name.casecmp('others').zero?
+
+ sanitized_group_name = group_name.downcase.tr(' ', '_').gsub(/[^a-z0-9_]+/, '')
+ "#{sanitized_group_name}_swagger.json"
+ end
+
+ def _create_symlink(source_file_path, target_file_path)
+ FileUtils.rm_f(target_file_path) # Remove existing to avoid errors
+
+ if File.exist?(source_file_path)
+ relative_source_path = Pathname.new(source_file_path).relative_path_from(target_file_path.dirname)
+ FileUtils.ln_sf(relative_source_path, target_file_path)
+ else
+ puts "Warning: Source file #{source_file_path} not found. Skipping symlink for #{File.basename(target_file_path)}."
+ end
end
end
end
+
+namespace :swagger do
+ desc 'build combined swagger.json file from all the fragmented definitions and paths inside swagger folder'
+ task build: :environment do
+ SwaggerTaskActions.execute_build
+ end
+
+ desc 'build separate swagger files for each tag group'
+ task build_tag_groups: :environment do
+ SwaggerTaskActions.execute_build_tag_groups
+ end
+
+ desc 'build swagger files and create symlinks in developer-docs'
+ task build_for_docs: :environment do
+ SwaggerTaskActions.execute_build_for_docs
+ end
+end
diff --git a/package.json b/package.json
index 94ea2b95a..8372ee06e 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@chatwoot/chatwoot",
- "version": "4.1.0",
+ "version": "4.2.0",
"license": "MIT",
"scripts": {
"eslint": "eslint app/**/*.{js,vue}",
diff --git a/public/assets/images/dashboard/captain/logo.svg b/public/assets/images/dashboard/captain/logo.svg
new file mode 100644
index 000000000..7eb14df2b
--- /dev/null
+++ b/public/assets/images/dashboard/captain/logo.svg
@@ -0,0 +1,6 @@
+
diff --git a/spec/builders/account_builder_spec.rb b/spec/builders/account_builder_spec.rb
new file mode 100644
index 000000000..86cb4cf73
--- /dev/null
+++ b/spec/builders/account_builder_spec.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+RSpec.describe AccountBuilder do
+ let(:email) { 'user@example.com' }
+ let(:user_password) { 'Password123!' }
+ let(:account_name) { 'Test Account' }
+ let(:user_full_name) { 'Test User' }
+ let(:validation_service) { instance_double(Account::SignUpEmailValidationService, perform: true) }
+ let(:account_builder) do
+ described_class.new(
+ account_name: account_name,
+ email: email,
+ user_full_name: user_full_name,
+ user_password: user_password,
+ confirmed: true
+ )
+ end
+
+ # Mock the email validation service
+ before do
+ allow(Account::SignUpEmailValidationService).to receive(:new).with(email).and_return(validation_service)
+ end
+
+ describe '#perform' do
+ context 'when valid params are passed' do
+ it 'creates a new account with correct name' do
+ _user, account = account_builder.perform
+ expect(account).to be_an(Account)
+ expect(account.name).to eq(account_name)
+ end
+
+ it 'creates a new confirmed user with correct details' do
+ user, _account = account_builder.perform
+ expect(user).to be_a(User)
+ expect(user.email).to eq(email)
+ expect(user.name).to eq(user_full_name)
+ expect(user.confirmed?).to be(true)
+ end
+
+ it 'links user to account as administrator' do
+ user, account = account_builder.perform
+ expect(user.account_users.first.role).to eq('administrator')
+ expect(user.accounts.first).to eq(account)
+ end
+
+ it 'increments the counts of models' do
+ expect do
+ account_builder.perform
+ end.to change(Account, :count).by(1)
+ .and change(User, :count).by(1)
+ .and change(AccountUser, :count).by(1)
+ end
+ end
+ end
+end
diff --git a/spec/builders/messages/instagram/message_builder_spec.rb b/spec/builders/messages/instagram/message_builder_spec.rb
index 0dbe87afa..8e863823a 100644
--- a/spec/builders/messages/instagram/message_builder_spec.rb
+++ b/spec/builders/messages/instagram/message_builder_spec.rb
@@ -79,6 +79,18 @@ describe Messages::Instagram::MessageBuilder do
expect(instagram_inbox.messages.count).to be 1
end
+ it 'discards duplicate messages from webhook events with the same message_id' do
+ messaging = dm_params[:entry][0]['messaging'][0]
+ described_class.new(messaging, instagram_inbox).perform
+
+ initial_message_count = instagram_inbox.messages.count
+ expect(initial_message_count).to be 1
+
+ described_class.new(messaging, instagram_inbox).perform
+
+ expect(instagram_inbox.messages.count).to eq initial_message_count
+ end
+
it 'creates message for shared reel' do
messaging = shared_reel_params[:entry][0]['messaging'][0]
described_class.new(messaging, instagram_inbox).perform
@@ -151,11 +163,15 @@ describe Messages::Instagram::MessageBuilder do
end
it 'does not create message for unsupported file type' do
+ conversation
+
+ # try to create a message with unsupported file type
story_mention_params[:entry][0][:messaging][0]['message']['attachments'][0]['type'] = 'unsupported_type'
messaging = story_mention_params[:entry][0][:messaging][0]
described_class.new(messaging, instagram_inbox, outgoing_echo: false).perform
+ # Conversation should exist but no new message should be created
expect(instagram_inbox.conversations.count).to be 1
expect(instagram_inbox.messages.count).to be 0
end
diff --git a/spec/builders/messages/instagram/messenger/message_builder_spec.rb b/spec/builders/messages/instagram/messenger/message_builder_spec.rb
index 78c97b071..03194673a 100644
--- a/spec/builders/messages/instagram/messenger/message_builder_spec.rb
+++ b/spec/builders/messages/instagram/messenger/message_builder_spec.rb
@@ -189,19 +189,22 @@ describe Messages::Instagram::Messenger::MessageBuilder do
profile_pic: 'https://chatwoot-assets.local/sample.png'
}.with_indifferent_access
)
+
+ conversation
+
+ # create a message with unsupported file type
story_mention_params[:entry][0][:messaging][0]['message']['attachments'][0]['type'] = 'unsupported_type'
messaging = story_mention_params[:entry][0][:messaging][0]
- contact_inbox
+
described_class.new(messaging, instagram_messenger_inbox, outgoing_echo: false).perform
instagram_messenger_inbox.reload
- # we would have contact created but message and attachments won't be created
+ # Conversation should exist but no new message should be created
expect(instagram_messenger_inbox.conversations.count).to be 1
expect(instagram_messenger_inbox.messages.count).to be 0
contact = instagram_messenger_channel.inbox.contacts.first
-
expect(contact.name).to eq('Jane Dae')
end
end
diff --git a/spec/builders/v2/reports/conversations/report_builder_spec.rb b/spec/builders/v2/reports/conversations/report_builder_spec.rb
index d3cde98e6..db7a0ac45 100644
--- a/spec/builders/v2/reports/conversations/report_builder_spec.rb
+++ b/spec/builders/v2/reports/conversations/report_builder_spec.rb
@@ -33,12 +33,12 @@ describe V2::Reports::Conversations::ReportBuilder do
end
describe '#timeseries' do
- include_examples 'valid metric handler', 'avg_first_response_time', :timeseries, V2::Reports::Timeseries::AverageReportBuilder
- include_examples 'valid metric handler', 'conversations_count', :timeseries, V2::Reports::Timeseries::CountReportBuilder
+ it_behaves_like 'valid metric handler', 'avg_first_response_time', :timeseries, V2::Reports::Timeseries::AverageReportBuilder
+ it_behaves_like 'valid metric handler', 'conversations_count', :timeseries, V2::Reports::Timeseries::CountReportBuilder
end
describe '#aggregate_value' do
- include_examples 'valid metric handler', 'avg_first_response_time', :aggregate_value, V2::Reports::Timeseries::AverageReportBuilder
- include_examples 'valid metric handler', 'conversations_count', :aggregate_value, V2::Reports::Timeseries::CountReportBuilder
+ it_behaves_like 'valid metric handler', 'avg_first_response_time', :aggregate_value, V2::Reports::Timeseries::AverageReportBuilder
+ it_behaves_like 'valid metric handler', 'conversations_count', :aggregate_value, V2::Reports::Timeseries::CountReportBuilder
end
end
diff --git a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb
index 7b3dafccb..96272f9ac 100644
--- a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb
+++ b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb
@@ -147,6 +147,32 @@ RSpec.describe 'Inboxes API', type: :request do
expect(data[:imap_login]).to eq('test@test.com')
end
+ context 'when it is a Twilio inbox' do
+ let(:twilio_channel) { create(:channel_twilio_sms, account: account, account_sid: 'AC123', auth_token: 'secrettoken') }
+ let(:twilio_inbox) { create(:inbox, channel: twilio_channel, account: account) }
+
+ it 'returns auth_token and account_sid for admin' do
+ get "/api/v1/accounts/#{account.id}/inboxes/#{twilio_inbox.id}",
+ headers: admin.create_new_auth_token,
+ as: :json
+ expect(response).to have_http_status(:success)
+ data = JSON.parse(response.body, symbolize_names: true)
+ expect(data[:auth_token]).to eq('secrettoken')
+ expect(data[:account_sid]).to eq('AC123')
+ end
+
+ it "doesn't return auth_token and account_sid for agent" do
+ create(:inbox_member, user: agent, inbox: twilio_inbox)
+ get "/api/v1/accounts/#{account.id}/inboxes/#{twilio_inbox.id}",
+ headers: agent.create_new_auth_token,
+ as: :json
+ expect(response).to have_http_status(:success)
+ data = JSON.parse(response.body, symbolize_names: true)
+ expect(data[:auth_token]).to be_nil
+ expect(data[:account_sid]).to be_nil
+ end
+ end
+
it 'fetch API inbox without hmac token when agent' do
api_channel = create(:channel_api, account: account)
api_inbox = create(:inbox, channel: api_channel, account: account)
@@ -518,6 +544,22 @@ RSpec.describe 'Inboxes API', type: :request do
expect(email_channel.reload.email).to eq('emailtest@email.test')
end
+ it 'updates twilio sms inbox when administrator' do
+ twilio_sms_channel = create(:channel_twilio_sms, account: account)
+ twilio_sms_inbox = create(:inbox, channel: twilio_sms_channel, account: account)
+ expect(twilio_sms_inbox.reload.channel.account_sid).not_to eq('account_sid')
+ expect(twilio_sms_inbox.reload.channel.auth_token).not_to eq('new_auth_token')
+
+ patch "/api/v1/accounts/#{account.id}/inboxes/#{twilio_sms_inbox.id}",
+ headers: admin.create_new_auth_token,
+ params: { channel: { account_sid: 'account_sid', auth_token: 'new_auth_token' } },
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ expect(twilio_sms_inbox.reload.channel.account_sid).to eq('account_sid')
+ expect(twilio_sms_inbox.reload.channel.auth_token).to eq('new_auth_token')
+ end
+
it 'updates email inbox with imap when administrator' do
email_channel = create(:channel_email, account: account)
email_inbox = create(:inbox, channel: email_channel, account: account)
@@ -675,6 +717,94 @@ RSpec.describe 'Inboxes API', type: :request do
expect(email_channel.reload.smtp_authentication).to eq('plain')
end
end
+
+ context 'when handling CSAT configuration' do
+ let(:admin) { create(:user, account: account, role: :administrator) }
+ let(:inbox) { create(:inbox, account: account) }
+ let(:csat_config) do
+ {
+ 'display_type' => 'emoji',
+ 'message' => 'How would you rate your experience?',
+ 'survey_rules' => {
+ 'operator' => 'contains',
+ 'values' => %w[support help]
+ }
+ }
+ end
+
+ it 'successfully updates the inbox with CSAT configuration' do
+ patch "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}",
+ params: {
+ csat_survey_enabled: true,
+ csat_config: csat_config
+ },
+ headers: admin.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ end
+
+ context 'when CSAT is configured' do
+ before do
+ patch "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}",
+ params: {
+ csat_survey_enabled: true,
+ csat_config: csat_config
+ },
+ headers: admin.create_new_auth_token,
+ as: :json
+ end
+
+ it 'returns configured CSAT settings in inbox details' do
+ get "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}",
+ headers: admin.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ json_response = response.parsed_body
+ expect(json_response['csat_survey_enabled']).to be true
+
+ saved_config = json_response['csat_config']
+ expect(saved_config).to be_present
+ expect(saved_config['display_type']).to eq('emoji')
+ end
+
+ it 'returns configured CSAT message' do
+ get "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}",
+ headers: admin.create_new_auth_token,
+ as: :json
+
+ json_response = response.parsed_body
+ saved_config = json_response['csat_config']
+ expect(saved_config['message']).to eq('How would you rate your experience?')
+ end
+
+ it 'returns configured CSAT survey rules' do
+ get "/api/v1/accounts/#{account.id}/inboxes/#{inbox.id}",
+ headers: admin.create_new_auth_token,
+ as: :json
+
+ json_response = response.parsed_body
+ saved_config = json_response['csat_config']
+ expect(saved_config['survey_rules']['operator']).to eq('contains')
+ expect(saved_config['survey_rules']['values']).to match_array(%w[support help])
+ end
+
+ it 'includes CSAT configuration in inbox list' do
+ get "/api/v1/accounts/#{account.id}/inboxes",
+ headers: admin.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ inbox_list = response.parsed_body
+ found_inbox = inbox_list['payload'].find { |i| i['id'] == inbox.id }
+
+ expect(found_inbox['csat_survey_enabled']).to be true
+ expect(found_inbox['csat_config']).to be_present
+ expect(found_inbox['csat_config']['display_type']).to eq('emoji')
+ end
+ end
+ end
end
describe 'GET /api/v1/accounts/{account.id}/inboxes/{inbox.id}/agent_bot' do
diff --git a/spec/controllers/api/v1/accounts/integrations/linear_controller_spec.rb b/spec/controllers/api/v1/accounts/integrations/linear_controller_spec.rb
index b1341e65e..0f27e2bd2 100644
--- a/spec/controllers/api/v1/accounts/integrations/linear_controller_spec.rb
+++ b/spec/controllers/api/v1/accounts/integrations/linear_controller_spec.rb
@@ -100,6 +100,7 @@ RSpec.describe 'Linear Integration API', type: :request do
description: 'This is a sample issue.',
assignee_id: 'user1',
priority: 'high',
+ state_id: 'state1',
label_ids: ['label1']
}
end
diff --git a/spec/controllers/devise/omniauth_callbacks_controller_spec.rb b/spec/controllers/devise/omniauth_callbacks_controller_spec.rb
index 3513b9c34..1a775f88f 100644
--- a/spec/controllers/devise/omniauth_callbacks_controller_spec.rb
+++ b/spec/controllers/devise/omniauth_callbacks_controller_spec.rb
@@ -3,6 +3,7 @@ require 'rails_helper'
RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
let(:account_builder) { double }
let(:user_double) { object_double(:user) }
+ let(:email_validation_service) { instance_double(Account::SignUpEmailValidationService) }
def set_omniauth_config(for_email = 'test@example.com')
OmniAuth.config.test_mode = true
@@ -17,13 +18,22 @@ RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
)
end
+ before do
+ allow(Account::SignUpEmailValidationService).to receive(:new).and_return(email_validation_service)
+ end
+
describe '#omniauth_sucess' do
+ before do
+ GlobalConfig.clear_cache
+ end
+
it 'allows signup' do
- with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true' do
+ with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true', FRONTEND_URL: 'http://www.example.com' do
set_omniauth_config('test_not_preset@example.com')
allow(AccountBuilder).to receive(:new).and_return(account_builder)
allow(account_builder).to receive(:perform).and_return(user_double)
allow(Avatar::AvatarFromUrlJob).to receive(:perform_later).and_return(true)
+ allow(email_validation_service).to receive(:perform).and_return(true)
get '/omniauth/google_oauth2/callback'
@@ -43,8 +53,10 @@ RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
end
it 'blocks personal accounts signup' do
- with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true' do
+ with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true', FRONTEND_URL: 'http://www.example.com' do
set_omniauth_config('personal@gmail.com')
+ allow(email_validation_service).to receive(:perform).and_raise(CustomExceptions::Account::InvalidEmail.new({ valid: false, disposable: nil }))
+
get '/omniauth/google_oauth2/callback'
# expect a 302 redirect to auth/google_oauth2/callback
@@ -57,10 +69,13 @@ RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
end
it 'blocks personal accounts signup with different Gmail case variations' do
- with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true' do
+ with_modified_env ENABLE_ACCOUNT_SIGNUP: 'true', FRONTEND_URL: 'http://www.example.com' do
# Test different case variations of Gmail
['personal@Gmail.com', 'personal@GMAIL.com', 'personal@Gmail.COM'].each do |email|
set_omniauth_config(email)
+ allow(email_validation_service).to receive(:perform).and_raise(CustomExceptions::Account::InvalidEmail.new({ valid: false,
+ disposable: nil }))
+
get '/omniauth/google_oauth2/callback'
# expect a 302 redirect to auth/google_oauth2/callback
@@ -76,8 +91,10 @@ RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
# This test does not affect line coverage, but it is important to ensure that the logic
# does not allow any signup if the ENV explicitly disables it
it 'blocks signup if ENV disabled' do
- with_modified_env ENABLE_ACCOUNT_SIGNUP: 'false' do
+ with_modified_env ENABLE_ACCOUNT_SIGNUP: 'false', FRONTEND_URL: 'http://www.example.com' do
set_omniauth_config('does-not-exist-for-sure@example.com')
+ allow(email_validation_service).to receive(:perform).and_return(true)
+
get '/omniauth/google_oauth2/callback'
# expect a 302 redirect to auth/google_oauth2/callback
@@ -90,38 +107,42 @@ RSpec.describe 'DeviseOverrides::OmniauthCallbacksController', type: :request do
end
it 'allows login' do
- create(:user, email: 'test@example.com')
- set_omniauth_config('test@example.com')
+ with_modified_env FRONTEND_URL: 'http://www.example.com' do
+ create(:user, email: 'test@example.com')
+ set_omniauth_config('test@example.com')
- get '/omniauth/google_oauth2/callback'
- # expect a 302 redirect to auth/google_oauth2/callback
- expect(response).to redirect_to('http://www.example.com/auth/google_oauth2/callback')
+ get '/omniauth/google_oauth2/callback'
+ # expect a 302 redirect to auth/google_oauth2/callback
+ expect(response).to redirect_to('http://www.example.com/auth/google_oauth2/callback')
- follow_redirect!
- expect(response).to redirect_to(%r{/app/login\?email=.+&sso_auth_token=.+$})
+ follow_redirect!
+ expect(response).to redirect_to(%r{/app/login\?email=.+&sso_auth_token=.+$})
- # expect app/login page to respond with 200 and render
- follow_redirect!
- expect(response).to have_http_status(:ok)
+ # expect app/login page to respond with 200 and render
+ follow_redirect!
+ expect(response).to have_http_status(:ok)
+ end
end
# from a line coverage point of view this may seem redundant
# but to ensure that the logic allows for existing users even if they have a gmail account
# we need to test this explicitly
it 'allows personal account login' do
- create(:user, email: 'personal-existing@gmail.com')
- set_omniauth_config('personal-existing@gmail.com')
+ with_modified_env FRONTEND_URL: 'http://www.example.com' do
+ create(:user, email: 'personal-existing@gmail.com')
+ set_omniauth_config('personal-existing@gmail.com')
- get '/omniauth/google_oauth2/callback'
- # expect a 302 redirect to auth/google_oauth2/callback
- expect(response).to redirect_to('http://www.example.com/auth/google_oauth2/callback')
+ get '/omniauth/google_oauth2/callback'
+ # expect a 302 redirect to auth/google_oauth2/callback
+ expect(response).to redirect_to('http://www.example.com/auth/google_oauth2/callback')
- follow_redirect!
- expect(response).to redirect_to(%r{/app/login\?email=.+&sso_auth_token=.+$})
+ follow_redirect!
+ expect(response).to redirect_to(%r{/app/login\?email=.+&sso_auth_token=.+$})
- # expect app/login page to respond with 200 and render
- follow_redirect!
- expect(response).to have_http_status(:ok)
+ # expect app/login page to respond with 200 and render
+ follow_redirect!
+ expect(response).to have_http_status(:ok)
+ end
end
end
end
diff --git a/spec/controllers/platform/api/v1/users_controller_spec.rb b/spec/controllers/platform/api/v1/users_controller_spec.rb
index 895f30b29..c73a03654 100644
--- a/spec/controllers/platform/api/v1/users_controller_spec.rb
+++ b/spec/controllers/platform/api/v1/users_controller_spec.rb
@@ -76,6 +76,54 @@ RSpec.describe 'Platform Users API', type: :request do
end
end
+ describe 'POST /platform/api/v1/users/{user_id}/token' do
+ context 'when it is an unauthenticated platform app' do
+ it 'returns unauthorized' do
+ post "/platform/api/v1/users/#{user.id}/token"
+ expect(response).to have_http_status(:unauthorized)
+ end
+ end
+
+ context 'when it is an invalid platform app token' do
+ it 'returns unauthorized' do
+ post "/platform/api/v1/users/#{user.id}/token", headers: { api_access_token: 'invalid' }, as: :json
+ expect(response).to have_http_status(:unauthorized)
+ end
+ end
+
+ context 'when it is an authenticated platform app' do
+ let(:platform_app) { create(:platform_app) }
+
+ it 'returns unauthorized when its not a permissible object' do
+ post "/platform/api/v1/users/#{user.id}/token", headers: { api_access_token: platform_app.access_token.token }, as: :json
+ expect(response).to have_http_status(:unauthorized)
+ end
+
+ it 'returns access token for the user with expiry and user info' do
+ create(:platform_app_permissible, platform_app: platform_app, permissible: user)
+
+ post "/platform/api/v1/users/#{user.id}/token",
+ headers: { api_access_token: platform_app.access_token.token }, as: :json
+
+ expect(response).to have_http_status(:success)
+ data = response.parsed_body
+
+ # Check access token and expiry
+ expect(data['access_token']).to eq(user.access_token.token)
+ expect(data['expiry']).to be_nil
+
+ # Check user info
+ expect(data['user']).to include(
+ 'id' => user.id,
+ 'name' => user.name,
+ 'display_name' => user.display_name,
+ 'email' => user.email,
+ 'pubsub_token' => user.pubsub_token
+ )
+ end
+ end
+ end
+
describe 'POST /platform/api/v1/users/' do
context 'when it is an unauthenticated platform app' do
it 'returns unauthorized' do
diff --git a/spec/enterprise/controllers/api/v1/accounts/captain/copilot_messages_controller_spec.rb b/spec/enterprise/controllers/api/v1/accounts/captain/copilot_messages_controller_spec.rb
new file mode 100644
index 000000000..511f4ea73
--- /dev/null
+++ b/spec/enterprise/controllers/api/v1/accounts/captain/copilot_messages_controller_spec.rb
@@ -0,0 +1,78 @@
+require 'rails_helper'
+
+RSpec.describe 'Api::V1::Accounts::Captain::CopilotMessagesController', type: :request do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account, role: :administrator) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user) }
+ let!(:copilot_message) { create(:captain_copilot_message, copilot_thread: copilot_thread, account: account) }
+
+ describe 'GET /api/v1/accounts/{account.id}/captain/copilot_threads/{thread.id}/copilot_messages' do
+ context 'when it is an authenticated user' do
+ it 'returns all messages' do
+ get "/api/v1/accounts/#{account.id}/captain/copilot_threads/#{copilot_thread.id}/copilot_messages",
+ headers: user.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ json_response = response.parsed_body
+ expect(json_response['payload'].length).to eq(1)
+ expect(json_response['payload'][0]['id']).to eq(copilot_message.id)
+ end
+ end
+
+ context 'when thread id is invalid' do
+ it 'returns not found error' do
+ get "/api/v1/accounts/#{account.id}/captain/copilot_threads/999999999/copilot_messages",
+ headers: user.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:not_found)
+ end
+ end
+ end
+
+ describe 'POST /api/v1/accounts/{account.id}/captain/copilot_threads/{thread.id}/copilot_messages' do
+ context 'when it is an authenticated user' do
+ it 'creates a new message' do
+ message_content = { 'content' => 'This is a test message' }
+
+ expect do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads/#{copilot_thread.id}/copilot_messages",
+ params: { message: message_content },
+ headers: user.create_new_auth_token,
+ as: :json
+ end.to change(CopilotMessage, :count).by(1)
+
+ expect(response).to have_http_status(:success)
+ expect(CopilotMessage.last.message).to eq({ 'content' => message_content })
+ expect(CopilotMessage.last.message_type).to eq('user')
+ expect(CopilotMessage.last.copilot_thread_id).to eq(copilot_thread.id)
+ end
+ end
+
+ context 'when thread does not exist' do
+ it 'returns not found error' do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads/999999999/copilot_messages",
+ params: { message: { text: 'Test message' } },
+ headers: user.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:not_found)
+ end
+ end
+
+ context 'when thread belongs to another user' do
+ let(:another_user) { create(:user, account: account) }
+ let(:another_thread) { create(:captain_copilot_thread, account: account, user: another_user) }
+
+ it 'returns not found error' do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads/#{another_thread.id}/copilot_messages",
+ params: { message: { text: 'Test message' } },
+ headers: user.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:not_found)
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/controllers/api/v1/accounts/captain/copilot_threads_controller_spec.rb b/spec/enterprise/controllers/api/v1/accounts/captain/copilot_threads_controller_spec.rb
new file mode 100644
index 000000000..b8fc628d1
--- /dev/null
+++ b/spec/enterprise/controllers/api/v1/accounts/captain/copilot_threads_controller_spec.rb
@@ -0,0 +1,112 @@
+require 'rails_helper'
+
+RSpec.describe 'Api::V1::Accounts::Captain::CopilotThreads', type: :request do
+ let(:account) { create(:account) }
+ let(:admin) { create(:user, account: account, role: :administrator) }
+ let(:agent) { create(:user, account: account, role: :agent) }
+ let(:conversation) { create(:conversation, account: account) }
+
+ def json_response
+ JSON.parse(response.body, symbolize_names: true)
+ end
+
+ describe 'GET /api/v1/accounts/{account.id}/captain/copilot_threads' do
+ context 'when it is an un-authenticated user' do
+ it 'does not fetch copilot threads' do
+ get "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ as: :json
+ expect(response).to have_http_status(:unauthorized)
+ end
+ end
+
+ context 'when it is an authenticated user' do
+ it 'fetches copilot threads for the current user' do
+ # Create threads for the current agent
+ create_list(:captain_copilot_thread, 3, account: account, user: agent)
+ # Create threads for another user (should not be included)
+ create_list(:captain_copilot_thread, 2, account: account, user: admin)
+
+ get "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ headers: agent.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ expect(json_response[:payload].length).to eq(3)
+
+ expect(json_response[:payload].map { |thread| thread[:user][:id] }.uniq).to eq([agent.id])
+ end
+
+ it 'returns threads in descending order of creation' do
+ threads = create_list(:captain_copilot_thread, 3, account: account, user: agent)
+
+ get "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ headers: agent.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:success)
+ expect(json_response[:payload].pluck(:id)).to eq(threads.reverse.pluck(:id))
+ end
+ end
+ end
+
+ describe 'POST /api/v1/accounts/{account.id}/captain/copilot_threads' do
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:valid_params) { { message: 'Hello, how can you help me?', assistant_id: assistant.id, conversation_id: conversation.display_id } }
+
+ context 'when it is an un-authenticated user' do
+ it 'returns unauthorized' do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ params: valid_params,
+ as: :json
+
+ expect(response).to have_http_status(:unauthorized)
+ end
+ end
+
+ context 'when it is an authenticated user' do
+ context 'with invalid params' do
+ it 'returns error when message is blank' do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ params: { message: '', assistant_id: assistant.id },
+ headers: agent.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:unprocessable_entity)
+ expect(json_response[:error]).to eq('Message is required')
+ end
+
+ it 'returns error when assistant_id is invalid' do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ params: { message: 'Hello', assistant_id: 0 },
+ headers: agent.create_new_auth_token,
+ as: :json
+
+ expect(response).to have_http_status(:not_found)
+ end
+ end
+
+ context 'with valid params' do
+ it 'creates a new copilot thread with initial message' do
+ expect do
+ post "/api/v1/accounts/#{account.id}/captain/copilot_threads",
+ params: valid_params,
+ headers: agent.create_new_auth_token,
+ as: :json
+ end.to change(CopilotThread, :count).by(1)
+ .and change(CopilotMessage, :count).by(1)
+
+ expect(response).to have_http_status(:success)
+
+ thread = CopilotThread.last
+ expect(thread.title).to eq(valid_params[:message])
+ expect(thread.user_id).to eq(agent.id)
+ expect(thread.assistant_id).to eq(assistant.id)
+
+ message = thread.copilot_messages.last
+ expect(message.message_type).to eq('user')
+ expect(message.message).to eq({ 'content' => valid_params[:message] })
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/jobs/captain/copilot/response_job_spec.rb b/spec/enterprise/jobs/captain/copilot/response_job_spec.rb
new file mode 100644
index 000000000..c8aacda5e
--- /dev/null
+++ b/spec/enterprise/jobs/captain/copilot/response_job_spec.rb
@@ -0,0 +1,41 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Copilot::ResponseJob, type: :job do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+ let(:conversation_id) { 123 }
+ let(:message) { { 'content' => 'Test message' } }
+
+ describe '#perform' do
+ let(:chat_service) { instance_double(Captain::Copilot::ChatService) }
+
+ before do
+ allow(Captain::Copilot::ChatService).to receive(:new).with(
+ assistant,
+ user_id: user.id,
+ copilot_thread_id: copilot_thread.id,
+ conversation_id: conversation_id
+ ).and_return(chat_service)
+ allow(chat_service).to receive(:generate_response).with(message)
+ end
+
+ it 'initializes ChatService with correct parameters and calls generate_response' do
+ expect(Captain::Copilot::ChatService).to receive(:new).with(
+ assistant,
+ user_id: user.id,
+ copilot_thread_id: copilot_thread.id,
+ conversation_id: conversation_id
+ )
+ expect(chat_service).to receive(:generate_response).with(message)
+ described_class.perform_now(
+ assistant: assistant,
+ conversation_id: conversation_id,
+ user_id: user.id,
+ copilot_thread_id: copilot_thread.id,
+ message: message
+ )
+ end
+ end
+end
diff --git a/spec/enterprise/jobs/captain/inbox_pending_conversations_resolution_job_spec.rb b/spec/enterprise/jobs/captain/inbox_pending_conversations_resolution_job_spec.rb
index 09f62272d..40f1ea294 100644
--- a/spec/enterprise/jobs/captain/inbox_pending_conversations_resolution_job_spec.rb
+++ b/spec/enterprise/jobs/captain/inbox_pending_conversations_resolution_job_spec.rb
@@ -9,8 +9,10 @@ RSpec.describe Captain::InboxPendingConversationsResolutionJob, type: :job do
let!(:recent_pending_conversation) { create(:conversation, inbox: inbox, last_activity_at: 10.minutes.ago, status: :pending) }
let!(:open_conversation) { create(:conversation, inbox: inbox, last_activity_at: 1.hour.ago, status: :open) }
+ let!(:captain_assistant) { create(:captain_assistant, account: inbox.account) }
+
before do
- create(:captain_inbox, inbox: inbox, captain_assistant: create(:captain_assistant, account: inbox.account))
+ create(:captain_inbox, inbox: inbox, captain_assistant: captain_assistant)
stub_const('Limits::BULK_ACTIONS_LIMIT', 2)
end
@@ -27,14 +29,34 @@ RSpec.describe Captain::InboxPendingConversationsResolutionJob, type: :job do
expect(open_conversation.reload.status).to eq('open')
end
- it 'creates an outgoing message for each resolved conversation' do
- # resolution message + system message
- expect { perform_enqueued_jobs { described_class.perform_later(inbox) } }
- .to change { resolvable_pending_conversation.messages.reload.count }.by(2)
+ it 'creates exactly one outgoing message with configured content' do
+ custom_message = 'This is a custom resolution message.'
+ captain_assistant.update!(config: { 'resolution_message' => custom_message })
- resolved_conversation_messages = resolvable_pending_conversation.messages.map(&:content)
- expect(resolved_conversation_messages).to include(
- 'Resolving the conversation as it has been inactive for a while. Please start a new conversation if you need further assistance.'
+ expect do
+ perform_enqueued_jobs { described_class.perform_later(inbox) }
+ end.to change { resolvable_pending_conversation.messages.outgoing.reload.count }.by(1)
+
+ outgoing_message = resolvable_pending_conversation.messages.outgoing.last
+ expect(outgoing_message.content).to eq(custom_message)
+ end
+
+ it 'creates an outgoing message with default auto resolution message if not configured' do
+ captain_assistant.update!(config: {})
+
+ perform_enqueued_jobs { described_class.perform_later(inbox) }
+ outgoing_message = resolvable_pending_conversation.messages.outgoing.last
+ expect(outgoing_message.content).to eq(
+ I18n.t('conversations.activity.auto_resolution_message')
+ )
+ end
+
+ it 'adds the correct activity message after resolution by Captain' do
+ perform_enqueued_jobs { described_class.perform_later(inbox) }
+ activity_message = resolvable_pending_conversation.messages.activity.last
+ expect(activity_message).not_to be_nil
+ expect(activity_message.content).to eq(
+ I18n.t('conversations.activity.captain.resolved', user_name: captain_assistant.name)
)
end
end
diff --git a/spec/enterprise/listeners/action_cable_listener_spec.rb b/spec/enterprise/listeners/action_cable_listener_spec.rb
new file mode 100644
index 000000000..9cb307809
--- /dev/null
+++ b/spec/enterprise/listeners/action_cable_listener_spec.rb
@@ -0,0 +1,24 @@
+require 'rails_helper'
+
+describe ActionCableListener do
+ describe '#copilot_message_created' do
+ let(:event_name) { :copilot_message_created }
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+ let(:copilot_message) { create(:captain_copilot_message, copilot_thread: copilot_thread) }
+ let(:event) { Events::Base.new(event_name, Time.zone.now, copilot_message: copilot_message) }
+ let(:listener) { described_class.instance }
+
+ it 'broadcasts message to the user' do
+ expect(ActionCableBroadcastJob).to receive(:perform_later).with(
+ [user.pubsub_token],
+ 'copilot.message.created',
+ copilot_message.push_event_data.merge(account_id: account.id)
+ )
+
+ listener.copilot_message_created(event)
+ end
+ end
+end
diff --git a/spec/enterprise/listeners/captain_listener_spec.rb b/spec/enterprise/listeners/captain_listener_spec.rb
new file mode 100644
index 000000000..1363ea033
--- /dev/null
+++ b/spec/enterprise/listeners/captain_listener_spec.rb
@@ -0,0 +1,57 @@
+require 'rails_helper'
+
+describe CaptainListener do
+ let(:listener) { described_class.instance }
+ let(:account) { create(:account) }
+ let(:inbox) { create(:inbox, account: account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account, config: { feature_memory: true, feature_faq: true }) }
+
+ describe '#conversation_resolved' do
+ let(:agent) { create(:user, account: account) }
+ let(:conversation) { create(:conversation, account: account, inbox: inbox, assignee: agent) }
+
+ let(:event_name) { :conversation_resolved }
+ let(:event) { Events::Base.new(event_name, Time.zone.now, conversation: conversation) }
+
+ before do
+ create(:captain_inbox, captain_assistant: assistant, inbox: inbox)
+ end
+
+ context 'when feature_memory is enabled' do
+ before do
+ assistant.config['feature_memory'] = true
+ assistant.config['feature_faq'] = false
+ assistant.save!
+ end
+
+ it 'generates and updates notes' do
+ expect(Captain::Llm::ContactNotesService)
+ .to receive(:new)
+ .with(assistant, conversation)
+ .and_return(instance_double(Captain::Llm::ContactNotesService, generate_and_update_notes: nil))
+ expect(Captain::Llm::ConversationFaqService).not_to receive(:new)
+
+ listener.conversation_resolved(event)
+ end
+ end
+
+ context 'when feature_faq is enabled' do
+ before do
+ assistant.config['feature_faq'] = true
+ assistant.config['feature_memory'] = false
+ assistant.save!
+ end
+
+ it 'generates and deduplicates FAQs' do
+ expect(Captain::Llm::ConversationFaqService)
+ .to receive(:new)
+ .with(assistant, conversation)
+ .and_return(instance_double(Captain::Llm::ConversationFaqService, generate_and_deduplicate: false))
+ expect(Captain::Llm::ContactNotesService).not_to receive(:new)
+
+ listener.conversation_resolved(event)
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/models/copilot_message_spec.rb b/spec/enterprise/models/copilot_message_spec.rb
new file mode 100644
index 000000000..6c0e496f2
--- /dev/null
+++ b/spec/enterprise/models/copilot_message_spec.rb
@@ -0,0 +1,63 @@
+require 'rails_helper'
+
+RSpec.describe CopilotMessage, type: :model do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+
+ describe 'validations' do
+ it { is_expected.to validate_presence_of(:message_type) }
+ it { is_expected.to validate_presence_of(:message) }
+ end
+
+ describe 'callbacks' do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+
+ describe '#ensure_account' do
+ it 'sets the account from the copilot thread before validation' do
+ message = build(:captain_copilot_message, copilot_thread: copilot_thread, account: nil)
+ message.valid?
+ expect(message.account).to eq(copilot_thread.account)
+ end
+ end
+
+ describe '#broadcast_message' do
+ it 'dispatches COPILOT_MESSAGE_CREATED event after create' do
+ message = build(:captain_copilot_message, copilot_thread: copilot_thread)
+
+ expect(Rails.configuration.dispatcher).to receive(:dispatch)
+ .with('copilot.message.created', anything, copilot_message: message)
+
+ message.save!
+ end
+ end
+ end
+
+ describe '#push_event_data' do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+ let(:message_content) { { 'content' => 'Test message' } }
+ let(:copilot_message) do
+ create(:captain_copilot_message,
+ copilot_thread: copilot_thread,
+ message_type: 'user',
+ message: message_content)
+ end
+
+ it 'returns the correct event data' do
+ event_data = copilot_message.push_event_data
+
+ expect(event_data[:id]).to eq(copilot_message.id)
+ expect(event_data[:message]).to eq(message_content)
+ expect(event_data[:message_type]).to eq('user')
+ expect(event_data[:created_at]).to eq(copilot_message.created_at.to_i)
+ expect(event_data[:copilot_thread]).to eq(copilot_thread.push_event_data)
+ end
+ end
+end
diff --git a/spec/enterprise/models/copilot_thread_spec.rb b/spec/enterprise/models/copilot_thread_spec.rb
new file mode 100644
index 000000000..a6a5f4a44
--- /dev/null
+++ b/spec/enterprise/models/copilot_thread_spec.rb
@@ -0,0 +1,62 @@
+require 'rails_helper'
+
+RSpec.describe CopilotThread, type: :model do
+ describe 'associations' do
+ it { is_expected.to belong_to(:user) }
+ it { is_expected.to belong_to(:account) }
+ it { is_expected.to belong_to(:assistant).class_name('Captain::Assistant') }
+ it { is_expected.to have_many(:copilot_messages).dependent(:destroy_async) }
+ end
+
+ describe 'validations' do
+ it { is_expected.to validate_presence_of(:title) }
+ end
+
+ describe '#push_event_data' do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant, title: 'Test Thread') }
+
+ it 'returns the correct event data' do
+ event_data = copilot_thread.push_event_data
+
+ expect(event_data[:id]).to eq(copilot_thread.id)
+ expect(event_data[:title]).to eq('Test Thread')
+ expect(event_data[:created_at]).to eq(copilot_thread.created_at.to_i)
+ expect(event_data[:user]).to eq(user.push_event_data)
+ expect(event_data[:account_id]).to eq(account.id)
+ end
+ end
+
+ describe '#previous_history' do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user, assistant: assistant) }
+
+ context 'when there are messages in the thread' do
+ before do
+ create(:captain_copilot_message, copilot_thread: copilot_thread, message_type: 'user', message: { 'content' => 'User message' })
+ create(:captain_copilot_message, copilot_thread: copilot_thread, message_type: 'assistant_thinking', message: { 'content' => 'Thinking...' })
+ create(:captain_copilot_message, copilot_thread: copilot_thread, message_type: 'assistant', message: { 'content' => 'Assistant message' })
+ end
+
+ it 'returns only user and assistant messages in chronological order' do
+ history = copilot_thread.previous_history
+
+ expect(history.length).to eq(2)
+ expect(history[0][:role]).to eq('user')
+ expect(history[0][:content]).to eq('User message')
+ expect(history[1][:role]).to eq('assistant')
+ expect(history[1][:content]).to eq('Assistant message')
+ end
+ end
+
+ context 'when there are no messages in the thread' do
+ it 'returns an empty array' do
+ expect(copilot_thread.previous_history).to eq([])
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/models/message_spec.rb b/spec/enterprise/models/message_spec.rb
new file mode 100644
index 000000000..5a9dc4e27
--- /dev/null
+++ b/spec/enterprise/models/message_spec.rb
@@ -0,0 +1,25 @@
+require 'rails_helper'
+
+RSpec.describe Message do
+ let!(:conversation) { create(:conversation) }
+
+ it 'updates first reply if the message is human and even if there are messages from captain' do
+ captain_assistant = create(:captain_assistant, account: conversation.account)
+ expect(conversation.first_reply_created_at).to be_nil
+
+ ## There is a difference on how the time is stored in the database and how it is retrieved
+ # This is because of the precision of the time stored in the database
+ # In the test, we will check whether the time is within the range
+ expect(conversation.waiting_since).to be_within(0.000001.seconds).of(conversation.created_at)
+
+ create(:message, message_type: :outgoing, conversation: conversation, sender: captain_assistant)
+
+ expect(conversation.first_reply_created_at).to be_nil
+ expect(conversation.waiting_since).to be_within(0.000001.seconds).of(conversation.created_at)
+
+ create(:message, message_type: :outgoing, conversation: conversation)
+
+ expect(conversation.first_reply_created_at).not_to be_nil
+ expect(conversation.waiting_since).to be_nil
+ end
+end
diff --git a/spec/enterprise/services/captain/copilot/chat_service_spec.rb b/spec/enterprise/services/captain/copilot/chat_service_spec.rb
index 5daabd5bf..a4274ec4e 100644
--- a/spec/enterprise/services/captain/copilot/chat_service_spec.rb
+++ b/spec/enterprise/services/captain/copilot/chat_service_spec.rb
@@ -2,87 +2,245 @@ require 'rails_helper'
RSpec.describe Captain::Copilot::ChatService do
let(:account) { create(:account, custom_attributes: { plan_name: 'startups' }) }
- let(:captain_inbox_association) { create(:captain_inbox, captain_assistant: assistant, inbox: inbox) }
- let(:mock_captain_agent) { instance_double(Captain::Agent) }
- let(:mock_captain_tool) { instance_double(Captain::Tool) }
- let(:mock_openai_client) { instance_double(OpenAI::Client) }
+ let(:user) { create(:user, account: account) }
let(:inbox) { create(:inbox, account: account) }
let(:assistant) { create(:captain_assistant, account: account) }
+ let(:contact) { create(:contact, account: account) }
+ let(:conversation) { create(:conversation, account: account, inbox: inbox, contact: contact) }
+ let(:mock_openai_client) { instance_double(OpenAI::Client) }
+ let(:copilot_thread) { create(:captain_copilot_thread, account: account, user: user) }
+ let!(:copilot_message) do
+ create(
+ :captain_copilot_message, account: account, copilot_thread: copilot_thread
+ )
+ end
+ let(:previous_history) { [{ role: copilot_message.message_type, content: copilot_message.message['content'] }] }
+
+ let(:config) do
+ { user_id: user.id, copilot_thread_id: copilot_thread.id, conversation_id: conversation.display_id }
+ end
before do
create(:installation_config, name: 'CAPTAIN_OPEN_AI_API_KEY', value: 'test-key')
+ allow(OpenAI::Client).to receive(:new).and_return(mock_openai_client)
+ allow(mock_openai_client).to receive(:chat).and_return({
+ choices: [{ message: { content: '{ "content": "Hey" }' } }]
+ }.with_indifferent_access)
end
describe '#initialize' do
- it 'sets default language to english when not specified' do
- service = described_class.new(assistant, { previous_messages: [], conversation_history: '' })
- expect(service.instance_variable_get(:@language)).to eq('english')
+ it 'sets up the service with correct instance variables' do
+ service = described_class.new(assistant, config)
+
+ expect(service.assistant).to eq(assistant)
+ expect(service.account).to eq(account)
+ expect(service.user).to eq(user)
+ expect(service.copilot_thread).to eq(copilot_thread)
+ expect(service.previous_history).to eq(previous_history)
end
- it 'uses the specified language when provided' do
- service = described_class.new(assistant, {
- previous_messages: [],
- conversation_history: '',
- language: 'spanish'
- })
- expect(service.instance_variable_get(:@language)).to eq('spanish')
+ it 'builds messages with system message and account context' do
+ service = described_class.new(assistant, config)
+ messages = service.messages
+
+ expect(messages.first[:role]).to eq('system')
+ expect(messages.second[:role]).to eq('system')
+ expect(messages.second[:content]).to include(account.id.to_s)
end
end
describe '#generate_response' do
- before do
- allow(OpenAI::Client).to receive(:new).and_return(mock_openai_client)
- allow(mock_openai_client).to receive(:chat).and_return({ choices: [{ message: { content: '{ "result": "Hey" }' } }] }.with_indifferent_access)
+ let(:service) { described_class.new(assistant, config) }
- allow(Captain::Agent).to receive(:new).and_return(mock_captain_agent)
- allow(mock_captain_agent).to receive(:execute).and_return(true)
- allow(mock_captain_agent).to receive(:register_tool).and_return(true)
+ it 'adds user input to messages when present' do
+ expect do
+ service.generate_response('Hello')
+ end.to(change { service.messages.count }.by(1))
- allow(Captain::Tool).to receive(:new).and_return(mock_captain_tool)
- allow(mock_captain_tool).to receive(:register_method).and_return(true)
-
- allow(account).to receive(:increment_response_usage).and_return(true)
+ last_message = service.messages.last
+ expect(last_message[:role]).to eq('user')
+ expect(last_message[:content]).to eq('Hello')
end
- it 'increments usage' do
- described_class.new(assistant, { previous_messages: ['Hello'], conversation_history: 'Hi' }).generate_response('Hey')
- expect(account).to have_received(:increment_response_usage).once
+ it 'does not add user input to messages when blank' do
+ expect do
+ service.generate_response('')
+ end.not_to(change { service.messages.count })
end
- it 'includes language in system message' do
- service = described_class.new(assistant, {
- previous_messages: [],
- conversation_history: '',
- language: 'spanish'
- })
+ it 'returns the response from request_chat_completion' do
+ expect(service.generate_response('Hello')).to eq({ 'content' => 'Hey' })
+ end
- allow(Captain::Llm::SystemPromptsService).to receive(:copilot_response_generator)
- .with(assistant.config['product_name'], 'spanish')
- .and_return('Spanish system prompt')
+ context 'when response contains tool calls' do
+ before do
+ allow(mock_openai_client).to receive(:chat).and_return(
+ {
+ choices: [{ message: { 'tool_calls' => tool_calls } }]
+ }.with_indifferent_access,
+ {
+ choices: [{ message: { content: '{ "content": "Tool response processed" }' } }]
+ }.with_indifferent_access
+ )
+ end
- system_message = service.send(:system_message)
- expect(system_message[:content]).to eq('Spanish system prompt')
+ context 'when tool call is valid' do
+ let(:tool_calls) do
+ [{
+ 'id' => 'call_123',
+ 'function' => {
+ 'name' => 'get_conversation',
+ 'arguments' => "{ \"conversation_id\": #{conversation.display_id} }"
+ }
+ }]
+ end
+
+ it 'processes tool calls and appends them to messages' do
+ result = service.generate_response("Find conversation #{conversation.id}")
+
+ expect(result).to eq({ 'content' => 'Tool response processed' })
+ expect(service.messages).to include(
+ { role: 'assistant', tool_calls: tool_calls }
+ )
+ expect(service.messages).to include(
+ {
+ role: 'tool', tool_call_id: 'call_123', content: conversation.to_llm_text
+ }
+ )
+
+ expect(result).to eq({ 'content' => 'Tool response processed' })
+ end
+ end
+
+ context 'when tool call is invalid' do
+ let(:tool_calls) do
+ [{
+ 'id' => 'call_123',
+ 'function' => {
+ 'name' => 'get_settings',
+ 'arguments' => '{}'
+ }
+ }]
+ end
+
+ it 'handles invalid tool calls' do
+ result = service.generate_response('Find settings')
+
+ expect(result).to eq({ 'content' => 'Tool response processed' })
+ expect(service.messages).to include(
+ {
+ role: 'assistant', tool_calls: tool_calls
+ }
+ )
+ expect(service.messages).to include(
+ {
+ role: 'tool',
+ tool_call_id: 'call_123',
+ content: 'Tool not available'
+ }
+ )
+ end
+ end
end
end
- describe '#execute' do
- before do
- allow(OpenAI::Client).to receive(:new).and_return(mock_openai_client)
- allow(mock_openai_client).to receive(:chat).and_return({ choices: [{ message: { content: '{ "result": "Hey" }' } }] }.with_indifferent_access)
-
- allow(Captain::Agent).to receive(:new).and_return(mock_captain_agent)
- allow(mock_captain_agent).to receive(:execute).and_return(true)
- allow(mock_captain_agent).to receive(:register_tool).and_return(true)
-
- allow(Captain::Tool).to receive(:new).and_return(mock_captain_tool)
- allow(mock_captain_tool).to receive(:register_method).and_return(true)
-
- allow(account).to receive(:increment_response_usage).and_return(true)
+ describe '#setup_user' do
+ it 'sets user when user_id is present in config' do
+ service = described_class.new(assistant, { user_id: user.id })
+ expect(service.user).to eq(user)
end
- it 'increments usage' do
- described_class.new(assistant, { previous_messages: ['Hello'], conversation_history: 'Hi' }).generate_response('Hey')
- expect(account).to have_received(:increment_response_usage).once
+ it 'does not set user when user_id is not present in config' do
+ service = described_class.new(assistant, {})
+ expect(service.user).to be_nil
+ end
+ end
+
+ describe '#setup_message_history' do
+ context 'when copilot_thread_id is present' do
+ it 'finds the copilot thread and sets previous history from it' do
+ service = described_class.new(assistant, { copilot_thread_id: copilot_thread.id })
+
+ expect(service.copilot_thread).to eq(copilot_thread)
+ expect(service.previous_history).to eq previous_history
+ end
+ end
+
+ context 'when copilot_thread_id is not present' do
+ it 'uses previous_history from config if present' do
+ custom_history = [{ role: 'user', content: 'Custom message' }]
+ service = described_class.new(assistant, { previous_history: custom_history })
+
+ expect(service.copilot_thread).to be_nil
+ expect(service.previous_history).to eq(custom_history)
+ end
+
+ it 'uses empty array if previous_history is not present in config' do
+ service = described_class.new(assistant, {})
+
+ expect(service.copilot_thread).to be_nil
+ expect(service.previous_history).to eq([])
+ end
+ end
+ end
+
+ describe '#build_messages' do
+ it 'includes system message and account context' do
+ service = described_class.new(assistant, {})
+ messages = service.messages
+
+ expect(messages.first[:role]).to eq('system')
+ expect(messages.second[:role]).to eq('system')
+ expect(messages.second[:content]).to include(account.id.to_s)
+ end
+
+ it 'includes previous history when present' do
+ custom_history = [{ role: 'user', content: 'Custom message' }]
+ service = described_class.new(assistant, { previous_history: custom_history })
+ messages = service.messages
+
+ expect(messages.count).to be >= 3
+ expect(messages.any? { |m| m[:content] == 'Custom message' }).to be true
+ end
+
+ it 'includes current viewing history when conversation_id is present' do
+ service = described_class.new(assistant, { conversation_id: conversation.display_id })
+ messages = service.messages
+
+ viewing_history = messages.find { |m| m[:content].include?('You are currently viewing the conversation') }
+ expect(viewing_history).not_to be_nil
+ expect(viewing_history[:content]).to include(conversation.display_id.to_s)
+ expect(viewing_history[:content]).to include(contact.id.to_s)
+ end
+ end
+
+ describe '#persist_message' do
+ context 'when copilot_thread is present' do
+ it 'creates a copilot message' do
+ allow(mock_openai_client).to receive(:chat).and_return({
+ choices: [{ message: { content: '{ "content": "Hey" }' } }]
+ }.with_indifferent_access)
+
+ expect do
+ described_class.new(assistant, { copilot_thread_id: copilot_thread.id }).generate_response('Hello')
+ end.to change(CopilotMessage, :count).by(1)
+
+ last_message = CopilotMessage.last
+ expect(last_message.message_type).to eq('assistant')
+ expect(last_message.message['content']).to eq('Hey')
+ end
+ end
+
+ context 'when copilot_thread is not present' do
+ it 'does not create a copilot message' do
+ allow(mock_openai_client).to receive(:chat).and_return({
+ choices: [{ message: { content: '{ "content": "Hey" }' } }]
+ }.with_indifferent_access)
+
+ expect do
+ described_class.new(assistant, {}).generate_response('Hello')
+ end.not_to(change(CopilotMessage, :count))
+ end
end
end
end
diff --git a/spec/enterprise/services/captain/tool_registry_service_spec.rb b/spec/enterprise/services/captain/tool_registry_service_spec.rb
new file mode 100644
index 000000000..c8d97fe3a
--- /dev/null
+++ b/spec/enterprise/services/captain/tool_registry_service_spec.rb
@@ -0,0 +1,112 @@
+require 'rails_helper'
+
+# Test tool implementation
+class TestTool < Captain::Tools::BaseService
+ attr_accessor :tool_active
+
+ def initialize(assistant, user: nil)
+ super
+ @tool_active = true
+ end
+
+ def name
+ 'test_tool'
+ end
+
+ def description
+ 'A test tool for specs'
+ end
+
+ def parameters
+ {
+ type: 'object',
+ properties: {
+ test_param: {
+ type: 'string'
+ }
+ }
+ }
+ end
+
+ def execute(*args)
+ args
+ end
+
+ def active?
+ @tool_active
+ end
+end
+
+RSpec.describe Captain::ToolRegistryService do
+ let(:assistant) { create(:captain_assistant) }
+ let(:service) { described_class.new(assistant) }
+
+ describe '#initialize' do
+ it 'initializes with empty tools and registered_tools' do
+ expect(service.tools).to be_empty
+ expect(service.registered_tools).to be_empty
+ end
+ end
+
+ describe '#register_tool' do
+ let(:tool_class) { TestTool }
+
+ context 'when tool is active' do
+ it 'registers a new tool' do
+ service.register_tool(tool_class)
+ expect(service.tools['test_tool']).to be_a(TestTool)
+ expect(service.registered_tools).to include(
+ {
+ type: 'function',
+ function: {
+ name: 'test_tool',
+ description: 'A test tool for specs',
+ parameters: {
+ type: 'object',
+ properties: {
+ test_param: {
+ type: 'string'
+ }
+ }
+ }
+ }
+ }
+ )
+ end
+ end
+
+ context 'when tool is inactive' do
+ it 'does not register the tool' do
+ tool = tool_class.new(assistant)
+ tool.tool_active = false
+ allow(tool_class).to receive(:new).and_return(tool)
+
+ service.register_tool(tool_class)
+
+ expect(service.tools['test_tool']).to be_nil
+ expect(service.registered_tools).to be_empty
+ end
+ end
+ end
+
+ describe 'method_missing' do
+ let(:tool_class) { TestTool }
+
+ before do
+ service.register_tool(tool_class)
+ end
+
+ context 'when method corresponds to a registered tool' do
+ it 'executes the tool with given arguments' do
+ result = service.test_tool(test_param: 'arg1')
+ expect(result).to eq([{ test_param: 'arg1' }])
+ end
+ end
+
+ context 'when method does not correspond to a registered tool' do
+ it 'raises NoMethodError' do
+ expect { service.unknown_tool }.to raise_error(NoMethodError)
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/get_article_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/get_article_service_spec.rb
new file mode 100644
index 000000000..72f4e1cb4
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/get_article_service_spec.rb
@@ -0,0 +1,112 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::GetArticleService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('get_article')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Get details of an article including its content and metadata')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ article_id: {
+ type: 'number',
+ description: 'The ID of the article to retrieve'
+ }
+ },
+ required: %w[article_id]
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when user is an admin' do
+ let(:user) { create(:user, :administrator, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with knowledge_base_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['knowledge_base_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role without knowledge_base_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when article_id is blank' do
+ it 'returns error message' do
+ expect(service.execute({})).to eq('Missing required parameters')
+ end
+ end
+
+ context 'when article is not found' do
+ it 'returns not found message' do
+ expect(service.execute({ 'article_id' => 999 })).to eq('Article not found')
+ end
+ end
+
+ context 'when article exists' do
+ let(:portal) { create(:portal, account: account) }
+ let(:article) { create(:article, account: account, portal: portal, author: user, title: 'Test Article', content: 'Content') }
+
+ it 'returns the article in llm text format' do
+ result = service.execute({ 'article_id' => article.id })
+ expect(result).to eq(article.to_llm_text)
+ end
+
+ context 'when article belongs to different account' do
+ let(:other_account) { create(:account) }
+ let(:other_portal) { create(:portal, account: other_account) }
+ let(:other_article) { create(:article, account: other_account, portal: other_portal, author: user, title: 'Other Article') }
+
+ it 'returns not found message' do
+ expect(service.execute({ 'article_id' => other_article.id })).to eq('Article not found')
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/get_contact_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/get_contact_service_spec.rb
new file mode 100644
index 000000000..de319bfa1
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/get_contact_service_spec.rb
@@ -0,0 +1,110 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::GetContactService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('get_contact')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Get details of a contact including their profile information')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ contact_id: {
+ type: 'number',
+ description: 'The ID of the contact to retrieve'
+ }
+ },
+ required: %w[contact_id]
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when user is an admin' do
+ let(:user) { create(:user, :administrator, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with contact_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['contact_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role without contact_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when contact_id is blank' do
+ it 'returns error message' do
+ expect(service.execute({})).to eq('Missing required parameters')
+ end
+ end
+
+ context 'when contact is not found' do
+ it 'returns not found message' do
+ expect(service.execute({ 'contact_id' => 999 })).to eq('Contact not found')
+ end
+ end
+
+ context 'when contact exists' do
+ let(:contact) { create(:contact, account: account) }
+
+ it 'returns the contact in llm text format' do
+ result = service.execute({ 'contact_id' => contact.id })
+ expect(result).to eq(contact.to_llm_text)
+ end
+
+ context 'when contact belongs to different account' do
+ let(:other_account) { create(:account) }
+ let(:other_contact) { create(:contact, account: other_account) }
+
+ it 'returns not found message' do
+ expect(service.execute({ 'contact_id' => other_contact.id })).to eq('Contact not found')
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/get_conversation_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/get_conversation_service_spec.rb
new file mode 100644
index 000000000..4d7f1adc7
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/get_conversation_service_spec.rb
@@ -0,0 +1,142 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::GetConversationService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('get_conversation')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Get details of a conversation including messages and contact information')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ conversation_id: {
+ type: 'number',
+ description: 'The ID of the conversation to retrieve'
+ }
+ },
+ required: %w[conversation_id]
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when user is an admin' do
+ let(:user) { create(:user, :administrator, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with conversation_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with conversation_unassigned_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_unassigned_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with conversation_participating_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_participating_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role without any conversation permissions' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when conversation_id is blank' do
+ it 'returns error message' do
+ expect(service.execute({})).to eq('Missing required parameters')
+ end
+ end
+
+ context 'when conversation is not found' do
+ it 'returns not found message' do
+ expect(service.execute({ 'conversation_id' => 999 })).to eq('Conversation not found')
+ end
+ end
+
+ context 'when conversation exists' do
+ let(:inbox) { create(:inbox, account: account) }
+ let(:conversation) { create(:conversation, account: account, inbox: inbox) }
+
+ it 'returns the conversation in llm text format' do
+ result = service.execute({ 'conversation_id' => conversation.display_id })
+ expect(result).to eq(conversation.to_llm_text)
+ end
+
+ context 'when conversation belongs to different account' do
+ let(:other_account) { create(:account) }
+ let(:other_inbox) { create(:inbox, account: other_account) }
+ let(:other_conversation) { create(:conversation, account: other_account, inbox: other_inbox) }
+
+ it 'returns not found message' do
+ expect(service.execute({ 'conversation_id' => other_conversation.display_id })).to eq('Conversation not found')
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/search_articles_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/search_articles_service_spec.rb
new file mode 100644
index 000000000..eb11e0d69
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/search_articles_service_spec.rb
@@ -0,0 +1,147 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::SearchArticlesService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('search_articles')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Search articles based on parameters')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ query: {
+ type: 'string',
+ description: 'Search articles by title or content (partial match)'
+ },
+ category_id: {
+ type: 'number',
+ description: 'Filter articles by category ID'
+ },
+ status: {
+ type: 'string',
+ enum: %w[draft published archived],
+ description: 'Filter articles by status'
+ }
+ },
+ required: ['query']
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when user is an admin' do
+ let(:user) { create(:user, :administrator, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user is an agent' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role with knowledge_base_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['knowledge_base_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has custom role without knowledge_base_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when query is blank' do
+ it 'returns error message' do
+ expect(service.execute({})).to eq('Missing required parameters')
+ end
+ end
+
+ context 'when no articles are found' do
+ it 'returns no articles found message' do
+ expect(service.execute({ 'query' => 'test' })).to eq('No articles found')
+ end
+ end
+
+ context 'when articles are found' do
+ let(:portal) { create(:portal, account: account) }
+ let!(:article1) { create(:article, account: account, portal: portal, author: user, title: 'Test Article 1', content: 'Content 1') }
+ let!(:article2) { create(:article, account: account, portal: portal, author: user, title: 'Test Article 2', content: 'Content 2') }
+
+ it 'returns formatted articles with count' do
+ result = service.execute({ 'query' => 'Test' })
+ expect(result).to include('Total number of articles: 2')
+ expect(result).to include(article1.to_llm_text)
+ expect(result).to include(article2.to_llm_text)
+ end
+
+ context 'when filtered by category' do
+ let(:category) { create(:category, slug: 'test-category', portal: portal, account: account) }
+ let!(:article3) { create(:article, account: account, portal: portal, author: user, category: category, title: 'Test Article 3') }
+
+ it 'returns only articles from the specified category' do
+ result = service.execute({ 'query' => 'Test', 'category_id' => category.id })
+ expect(result).to include('Total number of articles: 1')
+ expect(result).to include(article3.to_llm_text)
+ expect(result).not_to include(article1.to_llm_text)
+ expect(result).not_to include(article2.to_llm_text)
+ end
+ end
+
+ context 'when filtered by status' do
+ let!(:article3) { create(:article, account: account, portal: portal, author: user, title: 'Test Article 3', status: 'published') }
+ let!(:article4) { create(:article, account: account, portal: portal, author: user, title: 'Test Article 4', status: 'draft') }
+
+ it 'returns only articles with the specified status' do
+ result = service.execute({ 'query' => 'Test', 'status' => 'published' })
+ expect(result).to include(article3.to_llm_text)
+ expect(result).not_to include(article4.to_llm_text)
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/search_contacts_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/search_contacts_service_spec.rb
new file mode 100644
index 000000000..f54b2eddf
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/search_contacts_service_spec.rb
@@ -0,0 +1,113 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::SearchContactsService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('search_contacts')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Search contacts based on query parameters')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ email: {
+ type: 'string',
+ description: 'Filter contacts by email'
+ },
+ phone_number: {
+ type: 'string',
+ description: 'Filter contacts by phone number'
+ },
+ name: {
+ type: 'string',
+ description: 'Filter contacts by name (partial match)'
+ }
+ },
+ required: []
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when user has contact_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['contact_manage']) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user does not have contact_manage permission' do
+ let(:user) { create(:user, account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when contacts are found' do
+ let(:contact1) { create(:contact, account: account, email: 'test1@example.com', name: 'Test Contact 1', phone_number: '+1234567890') }
+ let(:contact2) { create(:contact, account: account, email: 'test2@example.com', name: 'Test Contact 2', phone_number: '+1234567891') }
+
+ before do
+ contact1
+ contact2
+ end
+
+ it 'returns contacts when filtered by email' do
+ result = service.execute({ 'email' => 'test1@example.com' })
+ expect(result).to include(contact1.to_llm_text)
+ expect(result).not_to include(contact2.to_llm_text)
+ end
+
+ it 'returns contacts when filtered by phone number' do
+ result = service.execute({ 'phone_number' => '+1234567890' })
+ expect(result).to include(contact1.to_llm_text)
+ expect(result).not_to include(contact2.to_llm_text)
+ end
+
+ it 'returns contacts when filtered by name' do
+ result = service.execute({ 'name' => 'Contact 1' })
+ expect(result).to include(contact1.to_llm_text)
+ expect(result).not_to include(contact2.to_llm_text)
+ end
+
+ it 'returns all matching contacts when no filters are provided' do
+ result = service.execute({})
+ expect(result).to include(contact1.to_llm_text)
+ expect(result).to include(contact2.to_llm_text)
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/search_conversations_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/search_conversations_service_spec.rb
new file mode 100644
index 000000000..ab0865bc2
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/search_conversations_service_spec.rb
@@ -0,0 +1,125 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::SearchConversationsService do
+ let(:account) { create(:account) }
+ let(:user) { create(:user, role: 'administrator', account: account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('search_conversations')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Search conversations based on parameters')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the correct parameter schema' do
+ params = service.parameters
+ expect(params[:type]).to eq('object')
+ expect(params[:properties]).to include(:contact_id, :status, :priority)
+ end
+ end
+
+ describe '#active?' do
+ context 'when user has conversation_manage permission' do
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_manage']) }
+ let(:user) { create(:user, account: account) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has conversation_unassigned_manage permission' do
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_unassigned_manage']) }
+ let(:user) { create(:user, account: account) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has conversation_participating_manage permission' do
+ let(:custom_role) { create(:custom_role, account: account, permissions: ['conversation_participating_manage']) }
+ let(:user) { create(:user, account: account) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user has no relevant conversation permissions' do
+ let(:custom_role) { create(:custom_role, account: account, permissions: []) }
+ let(:user) { create(:user, account: account) }
+
+ before do
+ account_user = AccountUser.find_by(user: user, account: account)
+ account_user.update(role: :agent, custom_role: custom_role)
+ end
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ describe '#execute' do
+ let(:contact) { create(:contact, account: account) }
+ let!(:open_conversation) { create(:conversation, account: account, contact: contact, status: 'open', priority: 'high') }
+ let!(:resolved_conversation) { create(:conversation, account: account, status: 'resolved', priority: 'low') }
+
+ it 'returns all conversations when no filters are applied' do
+ result = service.execute({})
+ expect(result).to include('Total number of conversations: 2')
+ expect(result).to include(open_conversation.to_llm_text(include_contact_details: true))
+ expect(result).to include(resolved_conversation.to_llm_text(include_contact_details: true))
+ end
+
+ it 'filters conversations by status' do
+ result = service.execute({ 'status' => 'open' })
+ expect(result).to include('Total number of conversations: 1')
+ expect(result).to include(open_conversation.to_llm_text(include_contact_details: true))
+ expect(result).not_to include(resolved_conversation.to_llm_text(include_contact_details: true))
+ end
+
+ it 'filters conversations by contact_id' do
+ result = service.execute({ 'contact_id' => contact.id })
+ expect(result).to include('Total number of conversations: 1')
+ expect(result).to include(open_conversation.to_llm_text(include_contact_details: true))
+ expect(result).not_to include(resolved_conversation.to_llm_text(include_contact_details: true))
+ end
+
+ it 'filters conversations by priority' do
+ result = service.execute({ 'priority' => 'high' })
+ expect(result).to include('Total number of conversations: 1')
+ expect(result).to include(open_conversation.to_llm_text(include_contact_details: true))
+ expect(result).not_to include(resolved_conversation.to_llm_text(include_contact_details: true))
+ end
+
+ it 'returns appropriate message when no conversations are found' do
+ result = service.execute({ 'status' => 'snoozed' })
+ expect(result).to eq('No conversations found')
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/copilot/search_linear_issues_service_spec.rb b/spec/enterprise/services/captain/tools/copilot/search_linear_issues_service_spec.rb
new file mode 100644
index 000000000..f987b7a6a
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/copilot/search_linear_issues_service_spec.rb
@@ -0,0 +1,146 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::Copilot::SearchLinearIssuesService do
+ let(:account) { create(:account) }
+ let(:assistant) { create(:captain_assistant, account: account) }
+ let(:user) { create(:user, account: account) }
+ let(:service) { described_class.new(assistant, user: user) }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('search_linear_issues')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Search Linear issues based on a search term')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the expected parameter schema' do
+ expect(service.parameters).to eq(
+ {
+ type: 'object',
+ properties: {
+ term: {
+ type: 'string',
+ description: 'The search term to find Linear issues'
+ }
+ },
+ required: %w[term]
+ }
+ )
+ end
+ end
+
+ describe '#active?' do
+ context 'when Linear integration is enabled' do
+ before do
+ create(:integrations_hook, :linear, account: account)
+ end
+
+ context 'when user is present' do
+ it 'returns true' do
+ expect(service.active?).to be true
+ end
+ end
+
+ context 'when user is not present' do
+ let(:service) { described_class.new(assistant) }
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+
+ context 'when Linear integration is not enabled' do
+ context 'when user is present' do
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+
+ context 'when user is not present' do
+ let(:service) { described_class.new(assistant) }
+
+ it 'returns false' do
+ expect(service.active?).to be false
+ end
+ end
+ end
+ end
+
+ describe '#execute' do
+ context 'when Linear integration is not enabled' do
+ it 'returns error message' do
+ expect(service.execute({ 'term' => 'test' })).to eq('Linear integration is not enabled')
+ end
+ end
+
+ context 'when Linear integration is enabled' do
+ let(:linear_service) { instance_double(Integrations::Linear::ProcessorService) }
+
+ before do
+ create(:integrations_hook, :linear, account: account)
+ allow(Integrations::Linear::ProcessorService).to receive(:new).and_return(linear_service)
+ end
+
+ context 'when term is blank' do
+ it 'returns error message' do
+ expect(service.execute({ 'term' => '' })).to eq('Missing required parameters')
+ end
+ end
+
+ context 'when search returns error' do
+ before do
+ allow(linear_service).to receive(:search_issue).and_return({ error: 'API Error' })
+ end
+
+ it 'returns the error message' do
+ expect(service.execute({ 'term' => 'test' })).to eq('API Error')
+ end
+ end
+
+ context 'when search returns no issues' do
+ before do
+ allow(linear_service).to receive(:search_issue).and_return({ data: [] })
+ end
+
+ it 'returns no issues found message' do
+ expect(service.execute({ 'term' => 'test' })).to eq('No issues found, I should try another similar search term')
+ end
+ end
+
+ context 'when search returns issues' do
+ let(:issues) do
+ [{
+ 'title' => 'Test Issue',
+ 'id' => 'TEST-123',
+ 'state' => { 'name' => 'In Progress' },
+ 'priority' => 4,
+ 'assignee' => { 'name' => 'John Doe' },
+ 'description' => 'Test description'
+ }]
+ end
+
+ before do
+ allow(linear_service).to receive(:search_issue).and_return({ data: issues })
+ end
+
+ it 'returns formatted issues' do
+ result = service.execute({ 'term' => 'test' })
+ expect(result).to include('Total number of issues: 1')
+ expect(result).to include('Title: Test Issue')
+ expect(result).to include('ID: TEST-123')
+ expect(result).to include('State: In Progress')
+ expect(result).to include('Priority: Low')
+ expect(result).to include('Assignee: John Doe')
+ expect(result).to include('Description: Test description')
+ end
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/captain/tools/search_documentation_service_spec.rb b/spec/enterprise/services/captain/tools/search_documentation_service_spec.rb
new file mode 100644
index 000000000..9f5586e6b
--- /dev/null
+++ b/spec/enterprise/services/captain/tools/search_documentation_service_spec.rb
@@ -0,0 +1,77 @@
+require 'rails_helper'
+
+RSpec.describe Captain::Tools::SearchDocumentationService do
+ let(:assistant) { create(:captain_assistant) }
+ let(:service) { described_class.new(assistant) }
+ let(:question) { 'How to create a new account?' }
+ let(:answer) { 'You can create a new account by clicking on the Sign Up button.' }
+ let(:external_link) { 'https://example.com/docs/create-account' }
+
+ describe '#name' do
+ it 'returns the correct service name' do
+ expect(service.name).to eq('search_documentation')
+ end
+ end
+
+ describe '#description' do
+ it 'returns the service description' do
+ expect(service.description).to eq('Search and retrieve documentation from knowledge base')
+ end
+ end
+
+ describe '#parameters' do
+ it 'returns the required parameters schema' do
+ expected_schema = {
+ type: 'object',
+ properties: {
+ search_query: {
+ type: 'string',
+ description: 'The search query to look up in the documentation.'
+ }
+ },
+ required: ['search_query']
+ }
+
+ expect(service.parameters).to eq(expected_schema)
+ end
+ end
+
+ describe '#execute' do
+ let!(:response) do
+ create(
+ :captain_assistant_response,
+ assistant: assistant,
+ question: question,
+ answer: answer,
+ status: 'approved'
+ )
+ end
+
+ let(:documentable) { create(:captain_document, external_link: external_link) }
+
+ context 'when matching responses exist' do
+ before do
+ response.update(documentable: documentable)
+ allow(Captain::AssistantResponse).to receive(:search).with(question).and_return([response])
+ end
+
+ it 'returns formatted responses for the search query' do
+ result = service.execute({ 'search_query' => question })
+
+ expect(result).to include(question)
+ expect(result).to include(answer)
+ expect(result).to include(external_link)
+ end
+ end
+
+ context 'when no matching responses exist' do
+ before do
+ allow(Captain::AssistantResponse).to receive(:search).with(question).and_return([])
+ end
+
+ it 'returns an empty string' do
+ expect(service.execute({ 'search_query' => question })).to eq('No FAQs found for the given query')
+ end
+ end
+ end
+end
diff --git a/spec/enterprise/services/enterprise/clearbit_lookup_service_spec.rb b/spec/enterprise/services/enterprise/clearbit_lookup_service_spec.rb
index 725aa6523..d746b9a83 100644
--- a/spec/enterprise/services/enterprise/clearbit_lookup_service_spec.rb
+++ b/spec/enterprise/services/enterprise/clearbit_lookup_service_spec.rb
@@ -49,6 +49,10 @@ RSpec.describe Enterprise::ClearbitLookupService do
end
context 'when Clearbit is not enabled' do
+ before do
+ GlobalConfig.clear_cache
+ end
+
it 'returns nil without making an API call' do
with_modified_env CLEARBIT_API_KEY: nil do
expect(Net::HTTP).not_to receive(:start)
diff --git a/spec/enterprise/services/enterprise/conversations/permission_filter_service_spec.rb b/spec/enterprise/services/enterprise/conversations/permission_filter_service_spec.rb
index b26832faf..0cfec97eb 100644
--- a/spec/enterprise/services/enterprise/conversations/permission_filter_service_spec.rb
+++ b/spec/enterprise/services/enterprise/conversations/permission_filter_service_spec.rb
@@ -9,6 +9,8 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
let(:admin) { create(:user, account: account, role: :administrator) }
let(:agent) { create(:user, account: account, role: :agent) }
let!(:inbox) { create(:inbox, account: account) }
+ let!(:inbox2) { create(:inbox, account: account) }
+ let!(:another_inbox_conversation) { create(:conversation, account: account, inbox: inbox2) }
# This inbox_member is used to establish the agent's access to the inbox
before { create(:inbox_member, user: agent, inbox: inbox) }
@@ -25,16 +27,14 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
expect(result).to include(assigned_conversation)
expect(result).to include(unassigned_conversation)
expect(result).to include(another_assigned_conversation)
- expect(result.count).to eq(3)
+ expect(result.count).to eq(4)
end
end
context 'when user is a regular agent' do
it 'returns all conversations in assigned inboxes' do
- inbox_ids = agent.inboxes.where(account_id: account.id).pluck(:id)
-
result = Conversations::PermissionFilterService.new(
- account.conversations.where(inbox_id: inbox_ids),
+ account.conversations,
agent,
account
).perform
@@ -42,6 +42,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
expect(result).to include(assigned_conversation)
expect(result).to include(unassigned_conversation)
expect(result).to include(another_assigned_conversation)
+ expect(result).not_to include(another_inbox_conversation)
expect(result.count).to eq(3)
end
end
@@ -52,7 +53,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Create a new isolated test environment
test_account = create(:account)
test_inbox = create(:inbox, account: test_account)
-
+ test_inbox2 = create(:inbox, account: test_account)
# Create test agent
test_agent = create(:user, account: test_account, role: :agent)
create(:inbox_member, user: test_agent, inbox: test_inbox)
@@ -66,6 +67,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: test_agent)
unassigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: nil)
other_assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: create(:user, account: test_account))
+ other_inbox_conversation = create(:conversation, account: test_account, inbox: test_inbox2, assignee: nil)
# Run the test
result = Conversations::PermissionFilterService.new(
@@ -79,6 +81,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
expect(result).to include(assigned_conversation)
expect(result).to include(unassigned_conversation)
expect(result).to include(other_assigned_conversation)
+ expect(result).not_to include(other_inbox_conversation)
end
end
@@ -87,6 +90,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Create a new isolated test environment
test_account = create(:account)
test_inbox = create(:inbox, account: test_account)
+ test_inbox2 = create(:inbox, account: test_account)
# Create test agent
test_agent = create(:user, account: test_account, role: :agent)
@@ -101,6 +105,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Create some conversations
other_conversation = create(:conversation, account: test_account, inbox: test_inbox)
assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: test_agent)
+ other_inbox_conversation = create(:conversation, account: test_account, inbox: test_inbox2, assignee: nil)
# Run the test
result = Conversations::PermissionFilterService.new(
@@ -114,6 +119,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
expect(result.first.assignee).to eq(test_agent)
expect(result).to include(assigned_conversation)
expect(result).not_to include(other_conversation)
+ expect(result).not_to include(other_inbox_conversation)
end
end
@@ -122,6 +128,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Create a new isolated test environment
test_account = create(:account)
test_inbox = create(:inbox, account: test_account)
+ test_inbox2 = create(:inbox, account: test_account)
# Create test agent
test_agent = create(:user, account: test_account, role: :agent)
@@ -137,6 +144,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: test_agent)
unassigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: nil)
other_assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: create(:user, account: test_account))
+ other_inbox_conversation = create(:conversation, account: test_account, inbox: test_inbox2, assignee: nil)
# Run the test
result = Conversations::PermissionFilterService.new(
@@ -152,6 +160,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Should NOT include conversations assigned to others
expect(result).not_to include(other_assigned_conversation)
+ expect(result).not_to include(other_inbox_conversation)
end
end
@@ -160,6 +169,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
# Create a new isolated test environment
test_account = create(:account)
test_inbox = create(:inbox, account: test_account)
+ test_inbox2 = create(:inbox, account: test_account)
# Create test agent
test_agent = create(:user, account: test_account, role: :agent)
@@ -176,6 +186,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
assigned_to_agent = create(:conversation, account: test_account, inbox: test_inbox, assignee: test_agent)
unassigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: nil)
other_assigned_conversation = create(:conversation, account: test_account, inbox: test_inbox, assignee: create(:user, account: test_account))
+ other_inbox_conversation = create(:conversation, account: test_account, inbox: test_inbox2, assignee: nil)
# Run the test
result = Conversations::PermissionFilterService.new(
@@ -191,6 +202,7 @@ RSpec.describe Enterprise::Conversations::PermissionFilterService do
expect(result).to include(unassigned_conversation)
expect(result).to include(assigned_to_agent)
expect(result).not_to include(other_assigned_conversation)
+ expect(result).not_to include(other_inbox_conversation)
end
end
end
diff --git a/spec/factories/articles.rb b/spec/factories/articles.rb
index e53549090..b86e422a9 100644
--- a/spec/factories/articles.rb
+++ b/spec/factories/articles.rb
@@ -1,13 +1,14 @@
FactoryBot.define do
factory :article, class: 'Article' do
- account_id { 1 }
- category_id { 1 }
+ account
+ category { nil }
+ portal
locale { 'en' }
- author_id { 1 }
+ association :author, factory: :user
title { "#{Faker::Movie.title} #{SecureRandom.hex}" }
content { 'MyText' }
description { 'MyDescrption' }
- status { 1 }
+ status { :published }
views { 0 }
end
end
diff --git a/spec/factories/captain/copilot_message.rb b/spec/factories/captain/copilot_message.rb
new file mode 100644
index 000000000..5d24d0ebf
--- /dev/null
+++ b/spec/factories/captain/copilot_message.rb
@@ -0,0 +1,8 @@
+FactoryBot.define do
+ factory :captain_copilot_message, class: 'CopilotMessage' do
+ account
+ copilot_thread { association :captain_copilot_thread }
+ message { { content: 'This is a test message' } }
+ message_type { 0 }
+ end
+end
diff --git a/spec/factories/captain/copilot_thread.rb b/spec/factories/captain/copilot_thread.rb
new file mode 100644
index 000000000..2c7a4170c
--- /dev/null
+++ b/spec/factories/captain/copilot_thread.rb
@@ -0,0 +1,8 @@
+FactoryBot.define do
+ factory :captain_copilot_thread, class: 'CopilotThread' do
+ account
+ user
+ title { Faker::Lorem.sentence }
+ assistant { create(:captain_assistant, account: account) }
+ end
+end
diff --git a/spec/factories/categories.rb b/spec/factories/categories.rb
index f7becf8fc..f9685b8b0 100644
--- a/spec/factories/categories.rb
+++ b/spec/factories/categories.rb
@@ -1,9 +1,10 @@
FactoryBot.define do
factory :category, class: 'Category' do
- portal { portal }
+ portal
name { 'MyString' }
description { 'MyText' }
position { 1 }
+ slug { name.parameterize }
after(:build) do |category|
category.account ||= category.portal.account
diff --git a/spec/jobs/internal/delete_accounts_job_spec.rb b/spec/jobs/internal/delete_accounts_job_spec.rb
new file mode 100644
index 000000000..514ecf6ab
--- /dev/null
+++ b/spec/jobs/internal/delete_accounts_job_spec.rb
@@ -0,0 +1,44 @@
+require 'rails_helper'
+
+RSpec.describe Internal::DeleteAccountsJob do
+ subject(:job) { described_class.perform_later }
+
+ let!(:account_marked_for_deletion) { create(:account) }
+ let!(:future_deletion_account) { create(:account) }
+ let!(:active_account) { create(:account) }
+ let(:account_deletion_service) { instance_double(AccountDeletionService, perform: true) }
+
+ before do
+ account_marked_for_deletion.update!(
+ custom_attributes: {
+ 'marked_for_deletion_at' => 1.day.ago.iso8601,
+ 'marked_for_deletion_reason' => 'user_requested'
+ }
+ )
+
+ future_deletion_account.update!(
+ custom_attributes: {
+ 'marked_for_deletion_at' => 3.days.from_now.iso8601,
+ 'marked_for_deletion_reason' => 'user_requested'
+ }
+ )
+
+ allow(AccountDeletionService).to receive(:new).and_return(account_deletion_service)
+ end
+
+ it 'enqueues the job' do
+ expect { job }.to have_enqueued_job(described_class)
+ .on_queue('scheduled_jobs')
+ end
+
+ describe '#perform' do
+ it 'calls AccountDeletionService for accounts past deletion date' do
+ described_class.new.perform
+
+ expect(AccountDeletionService).to have_received(:new).with(account: account_marked_for_deletion)
+ expect(AccountDeletionService).not_to have_received(:new).with(account: future_deletion_account)
+ expect(AccountDeletionService).not_to have_received(:new).with(account: active_account)
+ expect(account_deletion_service).to have_received(:perform)
+ end
+ end
+end
diff --git a/spec/lib/custom_markdown_renderer_spec.rb b/spec/lib/custom_markdown_renderer_spec.rb
index 550e7b637..939965e91 100644
--- a/spec/lib/custom_markdown_renderer_spec.rb
+++ b/spec/lib/custom_markdown_renderer_spec.rb
@@ -143,6 +143,17 @@ describe CustomMarkdownRenderer do
end
end
+ context 'when link is a wistia URL' do
+ let(:wistia_url) { 'https://chatwoot.wistia.com/medias/kjwjeq6f9i' }
+
+ it 'renders a custom element with Wistia embed code' do
+ output = render_markdown_link(wistia_url)
+ expect(output).to include('')
+ expect(output).to include(' 1.day.ago.iso8601, 'marked_for_deletion_reason' => 'user_requested' })
+ end
+ let(:soft_deleted_users) do
+ [
+ { id: 1, original_email: 'user1@example.com' },
+ { id: 2, original_email: 'user2@example.com' }
+ ]
+ end
+
+ describe 'account_deleted' do
+ it 'has the right subject format' do
+ subject = described_class.new.send(:subject_for, account)
+ expect(subject).to eq("Account Deletion Notice for #{account.id} - #{account.name}")
+ end
+
+ it 'includes soft deleted users in meta when provided' do
+ mailer_instance = described_class.new
+ allow(mailer_instance).to receive(:params).and_return(
+ { soft_deleted_users: soft_deleted_users }
+ )
+
+ meta = mailer_instance.send(:build_meta, account)
+
+ expect(meta['deleted_user_count']).to eq(2)
+ expect(meta['soft_deleted_users'].size).to eq(2)
+ expect(meta['soft_deleted_users'].first['user_id']).to eq('1')
+ expect(meta['soft_deleted_users'].first['user_email']).to eq('user1@example.com')
+ end
+ end
+end
diff --git a/spec/models/article_spec.rb b/spec/models/article_spec.rb
index 0dc17d472..161f3541d 100644
--- a/spec/models/article_spec.rb
+++ b/spec/models/article_spec.rb
@@ -167,4 +167,26 @@ RSpec.describe Article do
end
end
end
+
+ describe '#to_llm_text' do
+ it 'returns formatted article text' do
+ category = create(:category, name: 'Test Category', slug: 'test_category', portal_id: portal_1.id)
+ article = create(:article, title: 'Test Article', category_id: category.id, content: 'This is the content', portal_id: portal_1.id,
+ author_id: user.id)
+ expected_output = <<~TEXT
+ Title: #{article.title}
+ ID: #{article.id}
+ Status: #{article.status}
+ Category: #{category.name}
+ Author: #{user.name}
+ Views: #{article.views}
+ Created At: #{article.created_at}
+ Updated At: #{article.updated_at}
+ Content:
+ #{article.content}
+ TEXT
+
+ expect(article.to_llm_text).to eq(expected_output)
+ end
+ end
end
diff --git a/spec/models/conversation_spec.rb b/spec/models/conversation_spec.rb
index 9395f3e55..aef91603d 100644
--- a/spec/models/conversation_spec.rb
+++ b/spec/models/conversation_spec.rb
@@ -793,8 +793,8 @@ RSpec.describe Conversation do
end
context 'when a new conversation is created' do
- it 'sets last_activity_at to the created_at time' do
- expect(conversation.last_activity_at).to eq(conversation.created_at)
+ it 'sets last_activity_at to the created_at time (within DB precision)' do
+ expect(conversation.last_activity_at).to be_within(1.second).of(conversation.created_at)
end
end
diff --git a/spec/models/message_spec.rb b/spec/models/message_spec.rb
index 4c66e37ee..b4be3ac5a 100644
--- a/spec/models/message_spec.rb
+++ b/spec/models/message_spec.rb
@@ -475,4 +475,35 @@ RSpec.describe Message do
end
end
end
+
+ describe '#content' do
+ let(:conversation) { create(:conversation) }
+ let(:message) { create(:message, conversation: conversation, content_type: 'input_csat', content: 'Original content') }
+
+ it 'returns original content for web widget inbox' do
+ allow(message.inbox).to receive(:web_widget?).and_return(true)
+ expect(message.content).to eq('Original content')
+ end
+
+ context 'when inbox is not a web widget' do
+ before do
+ allow(message.inbox).to receive(:web_widget?).and_return(false)
+ allow(ENV).to receive(:fetch).with('FRONTEND_URL', nil).and_return('https://app.chatwoot.com')
+ end
+
+ it 'returns custom message with survey link when csat message is configured' do
+ allow(message.inbox).to receive(:csat_config).and_return({ 'message' => 'Custom survey message:' })
+ expected_content = "Custom survey message: https://app.chatwoot.com/survey/responses/#{conversation.uuid}"
+ expect(message.content).to eq(expected_content)
+ end
+
+ it 'returns default message with survey link when no custom csat message' do
+ allow(message.inbox).to receive(:csat_config).and_return(nil)
+ allow(I18n).to receive(:t).with('conversations.survey.response', link: "https://app.chatwoot.com/survey/responses/#{conversation.uuid}")
+ .and_return("Please rate your conversation: https://app.chatwoot.com/survey/responses/#{conversation.uuid}")
+ expected_content = "Please rate your conversation: https://app.chatwoot.com/survey/responses/#{conversation.uuid}"
+ expect(message.content).to eq(expected_content)
+ end
+ end
+ end
end
diff --git a/spec/services/account/sign_up_email_validation_service_spec.rb b/spec/services/account/sign_up_email_validation_service_spec.rb
new file mode 100644
index 000000000..3f907f02c
--- /dev/null
+++ b/spec/services/account/sign_up_email_validation_service_spec.rb
@@ -0,0 +1,74 @@
+# frozen_string_literal: true
+
+require 'rails_helper'
+
+RSpec.describe Account::SignUpEmailValidationService, type: :service do
+ let(:service) { described_class.new(email) }
+ let(:blocked_domains) { "gmail.com\noutlook.com" }
+ let(:valid_email_address) { instance_double(ValidEmail2::Address, valid?: true, disposable?: false) }
+ let(:disposable_email_address) { instance_double(ValidEmail2::Address, valid?: true, disposable?: true) }
+ let(:invalid_email_address) { instance_double(ValidEmail2::Address, valid?: false) }
+
+ before do
+ allow(GlobalConfigService).to receive(:load).with('BLOCKED_EMAIL_DOMAINS', '').and_return(blocked_domains)
+ end
+
+ describe '#perform' do
+ context 'when email is invalid format' do
+ let(:email) { 'invalid-email' }
+
+ it 'raises InvalidEmail with invalid message' do
+ allow(ValidEmail2::Address).to receive(:new).with(email).and_return(invalid_email_address)
+ expect { service.perform }.to raise_error do |error|
+ expect(error).to be_a(CustomExceptions::Account::InvalidEmail)
+ expect(error.message).to eq(I18n.t('errors.signup.invalid_email'))
+ end
+ end
+ end
+
+ context 'when domain is blocked' do
+ let(:email) { 'test@gmail.com' }
+
+ it 'raises InvalidEmail with blocked domain message' do
+ allow(ValidEmail2::Address).to receive(:new).with(email).and_return(valid_email_address)
+ expect { service.perform }.to raise_error do |error|
+ expect(error).to be_a(CustomExceptions::Account::InvalidEmail)
+ expect(error.message).to eq(I18n.t('errors.signup.blocked_domain'))
+ end
+ end
+ end
+
+ context 'when domain is blocked (case insensitive)' do
+ let(:email) { 'test@GMAIL.COM' }
+
+ it 'raises InvalidEmail with blocked domain message' do
+ allow(ValidEmail2::Address).to receive(:new).with(email).and_return(valid_email_address)
+ expect { service.perform }.to raise_error do |error|
+ expect(error).to be_a(CustomExceptions::Account::InvalidEmail)
+ expect(error.message).to eq(I18n.t('errors.signup.blocked_domain'))
+ end
+ end
+ end
+
+ context 'when email is from disposable provider' do
+ let(:email) { 'test@mailinator.com' }
+
+ it 'raises InvalidEmail with disposable message' do
+ allow(ValidEmail2::Address).to receive(:new).with(email).and_return(disposable_email_address)
+ expect { service.perform }.to raise_error do |error|
+ expect(error).to be_a(CustomExceptions::Account::InvalidEmail)
+ expect(error.message).to eq(I18n.t('errors.signup.disposable_email'))
+ end
+ end
+ end
+
+ context 'when email is valid business email' do
+ let(:email) { 'test@example.com' }
+
+ it 'returns true' do
+ allow(ValidEmail2::Address).to receive(:new).with(email).and_return(valid_email_address)
+ expect(service.perform).to be(true)
+ end
+ end
+ end
+end
diff --git a/spec/services/account_deletion_service_spec.rb b/spec/services/account_deletion_service_spec.rb
new file mode 100644
index 000000000..6b263c5b3
--- /dev/null
+++ b/spec/services/account_deletion_service_spec.rb
@@ -0,0 +1,63 @@
+require 'rails_helper'
+
+RSpec.describe AccountDeletionService do
+ let(:account) { create(:account) }
+ let(:mailer) { instance_double(ActionMailer::MessageDelivery, deliver_later: nil) }
+
+ describe '#perform' do
+ before do
+ allow(DeleteObjectJob).to receive(:perform_later)
+ allow(AdministratorNotifications::AccountComplianceMailer).to receive(:with).and_return(
+ instance_double(AdministratorNotifications::AccountComplianceMailer, account_deleted: mailer)
+ )
+ end
+
+ it 'enqueues DeleteObjectJob with the account' do
+ described_class.new(account: account).perform
+
+ expect(DeleteObjectJob).to have_received(:perform_later).with(account)
+ end
+
+ it 'sends a compliance notification email' do
+ described_class.new(account: account).perform
+
+ expect(AdministratorNotifications::AccountComplianceMailer).to have_received(:with) do |args|
+ expect(args[:account]).to eq(account)
+ expect(args).to include(:soft_deleted_users)
+ end
+ expect(mailer).to have_received(:deliver_later)
+ end
+
+ context 'when handling users' do
+ let(:user_with_one_account) { create(:user) }
+ let(:user_with_multiple_accounts) { create(:user) }
+ let(:second_account) { create(:account) }
+
+ before do
+ create(:account_user, user: user_with_one_account, account: account)
+ create(:account_user, user: user_with_multiple_accounts, account: account)
+ create(:account_user, user: user_with_multiple_accounts, account: second_account)
+ end
+
+ it 'soft deletes users who only belong to the deleted account' do
+ original_email = user_with_one_account.email
+
+ described_class.new(account: account).perform
+
+ # Reload the user to get the updated email
+ user_with_one_account.reload
+ expect(user_with_one_account.email).to eq("#{original_email}-deleted.com")
+ end
+
+ it 'does not modify emails for users belonging to multiple accounts' do
+ original_email = user_with_multiple_accounts.email
+
+ described_class.new(account: account).perform
+
+ # Reload the user to get the updated email
+ user_with_multiple_accounts.reload
+ expect(user_with_multiple_accounts.email).to eq(original_email)
+ end
+ end
+ end
+end
diff --git a/spec/services/conversations/message_window_service_spec.rb b/spec/services/conversations/message_window_service_spec.rb
index 34c5ebbad..32542e87e 100644
--- a/spec/services/conversations/message_window_service_spec.rb
+++ b/spec/services/conversations/message_window_service_spec.rb
@@ -56,6 +56,7 @@ RSpec.describe Conversations::MessageWindowService do
describe 'on Facebook channels' do
before do
stub_request(:post, /graph.facebook.com/)
+ GlobalConfig.clear_cache
end
let!(:facebook_channel) { create(:channel_facebook_page) }
diff --git a/spec/services/crm/leadsquared/mappers/contact_mapper_spec.rb b/spec/services/crm/leadsquared/mappers/contact_mapper_spec.rb
index 4e7c06fdb..b6bf51f93 100644
--- a/spec/services/crm/leadsquared/mappers/contact_mapper_spec.rb
+++ b/spec/services/crm/leadsquared/mappers/contact_mapper_spec.rb
@@ -16,6 +16,7 @@ RSpec.describe Crm::Leadsquared::Mappers::ContactMapper do
name: 'John',
last_name: 'Doe',
email: 'john@example.com',
+ # the phone number is intentionally wrong
phone_number: '+1234567890'
)
@@ -29,6 +30,19 @@ RSpec.describe Crm::Leadsquared::Mappers::ContactMapper do
'Source' => 'Test Brand'
)
end
+
+ it 'represents the phone number correctly' do
+ contact.update!(
+ name: 'John',
+ last_name: 'Doe',
+ email: 'john@example.com',
+ phone_number: '+917507684392'
+ )
+
+ mapped_data = described_class.map(contact)
+
+ expect(mapped_data).to include('Mobile' => '+91-7507684392')
+ end
end
end
end
diff --git a/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb b/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb
index 29f7136f1..85bb08d74 100644
--- a/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb
+++ b/spec/services/crm/leadsquared/mappers/conversation_mapper_spec.rb
@@ -183,7 +183,7 @@ RSpec.describe Crm::Leadsquared::Mappers::ConversationMapper do
expect(result.length).to be <= described_class::ACTIVITY_NOTE_MAX_SIZE + 100
# Verify that not all messages are included (some were truncated)
- expect(messages.count).to be > result.scan(/John Doe:/).count
+ expect(messages.count).to be > result.scan('John Doe:').count
end
it 'respects the ACTIVITY_NOTE_MAX_SIZE constant' do
diff --git a/spec/services/llm_formatter/article_llm_formatter_spec.rb b/spec/services/llm_formatter/article_llm_formatter_spec.rb
new file mode 100644
index 000000000..0f47beddb
--- /dev/null
+++ b/spec/services/llm_formatter/article_llm_formatter_spec.rb
@@ -0,0 +1,44 @@
+require 'rails_helper'
+
+RSpec.describe LlmFormatter::ArticleLlmFormatter do
+ let(:account) { create(:account) }
+ let(:portal) { create(:portal, account: account) }
+ let(:category) { create(:category, slug: 'test_category', portal: portal, account: account) }
+ let(:author) { create(:user, account: account) }
+ let(:formatter) { described_class.new(article) }
+
+ describe '#format' do
+ context 'when article has all details' do
+ let(:article) do
+ create(:article,
+ slug: 'test_article',
+ portal: portal, category: category, author: author, views: 100, account: account)
+ end
+
+ it 'formats article details correctly' do
+ expected_output = <<~TEXT
+ Title: #{article.title}
+ ID: #{article.id}
+ Status: #{article.status}
+ Category: #{category.name}
+ Author: #{author.name}
+ Views: #{article.views}
+ Created At: #{article.created_at}
+ Updated At: #{article.updated_at}
+ Content:
+ #{article.content}
+ TEXT
+
+ expect(formatter.format).to eq(expected_output)
+ end
+ end
+
+ context 'when article has no category' do
+ let(:article) { create(:article, portal: portal, category: nil, author: author, account: account) }
+
+ it 'shows Uncategorized for category' do
+ expect(formatter.format).to include('Category: Uncategorized')
+ end
+ end
+ end
+end
diff --git a/spec/services/llm_formatter/contact_llm_formatter_spec.rb b/spec/services/llm_formatter/contact_llm_formatter_spec.rb
new file mode 100644
index 000000000..bf3345b98
--- /dev/null
+++ b/spec/services/llm_formatter/contact_llm_formatter_spec.rb
@@ -0,0 +1,78 @@
+require 'rails_helper'
+
+RSpec.describe LlmFormatter::ContactLlmFormatter do
+ let(:account) { create(:account) }
+ let(:contact) { create(:contact, account: account, name: 'John Doe', email: 'john@example.com', phone_number: '+1234567890') }
+ let(:formatter) { described_class.new(contact) }
+
+ describe '#format' do
+ context 'when contact has no notes' do
+ it 'formats contact details correctly' do
+ expected_output = [
+ "Contact ID: ##{contact.id}",
+ 'Contact Attributes:',
+ 'Name: John Doe',
+ 'Email: john@example.com',
+ 'Phone: +1234567890',
+ 'Location: ',
+ 'Country Code: ',
+ 'Contact Notes:',
+ 'No notes for this contact'
+ ].join("\n")
+
+ expect(formatter.format).to eq(expected_output)
+ end
+ end
+
+ context 'when contact has notes' do
+ before do
+ create(:note, account: account, contact: contact, content: 'First interaction')
+ create(:note, account: account, contact: contact, content: 'Follow up needed')
+ end
+
+ it 'includes notes in the output' do
+ expected_output = [
+ "Contact ID: ##{contact.id}",
+ 'Contact Attributes:',
+ 'Name: John Doe',
+ 'Email: john@example.com',
+ 'Phone: +1234567890',
+ 'Location: ',
+ 'Country Code: ',
+ 'Contact Notes:',
+ ' - First interaction',
+ ' - Follow up needed'
+ ].join("\n")
+
+ expect(formatter.format).to eq(expected_output)
+ end
+ end
+
+ context 'when contact has custom attributes' do
+ let!(:custom_attribute) do
+ create(:custom_attribute_definition, account: account, attribute_model: 'contact_attribute', attribute_display_name: 'Company')
+ end
+
+ before do
+ contact.update(custom_attributes: { custom_attribute.attribute_key => 'Acme Inc' })
+ end
+
+ it 'includes custom attributes in the output' do
+ expected_output = [
+ "Contact ID: ##{contact.id}",
+ 'Contact Attributes:',
+ 'Name: John Doe',
+ 'Email: john@example.com',
+ 'Phone: +1234567890',
+ 'Location: ',
+ 'Country Code: ',
+ 'Company: Acme Inc',
+ 'Contact Notes:',
+ 'No notes for this contact'
+ ].join("\n")
+
+ expect(formatter.format).to eq(expected_output)
+ end
+ end
+ end
+end
diff --git a/spec/services/llm_formatter/conversation_llm_formatter_spec.rb b/spec/services/llm_formatter/conversation_llm_formatter_spec.rb
index 3838b8126..93fec14f7 100644
--- a/spec/services/llm_formatter/conversation_llm_formatter_spec.rb
+++ b/spec/services/llm_formatter/conversation_llm_formatter_spec.rb
@@ -47,5 +47,19 @@ RSpec.describe LlmFormatter::ConversationLlmFormatter do
expect(formatter.format).to eq(expected_output)
end
end
+
+ context 'when include_contact_details is true' do
+ it 'includes contact details' do
+ expected_output = [
+ "Conversation ID: ##{conversation.display_id}",
+ "Channel: #{conversation.inbox.channel.name}",
+ 'Message History:',
+ 'No messages in this conversation',
+ "Contact Details: #{conversation.contact.to_llm_text}"
+ ].join("\n")
+
+ expect(formatter.format(include_contact_details: true)).to eq(expected_output)
+ end
+ end
end
end
diff --git a/spec/services/message_templates/hook_execution_service_spec.rb b/spec/services/message_templates/hook_execution_service_spec.rb
index 9d9d82922..24e40ea8d 100644
--- a/spec/services/message_templates/hook_execution_service_spec.rb
+++ b/spec/services/message_templates/hook_execution_service_spec.rb
@@ -194,23 +194,44 @@ describe MessageTemplates::HookExecutionService do
expect(out_of_office_service).to have_received(:perform)
end
- it 'does not call ::MessageTemplates::Template::OutOfOffice when there are recent outgoing messages' do
- contact = create(:contact)
- conversation = create(:conversation, contact: contact)
+ context 'with recent outgoing messages' do
+ it 'does not call ::MessageTemplates::Template::OutOfOffice when there are recent outgoing messages' do
+ contact = create(:contact)
+ conversation = create(:conversation, contact: contact)
- conversation.inbox.update(working_hours_enabled: true, out_of_office_message: 'We are out of office')
- conversation.inbox.working_hours.today.update!(closed_all_day: true)
+ conversation.inbox.update(working_hours_enabled: true, out_of_office_message: 'We are out of office')
+ conversation.inbox.working_hours.today.update!(closed_all_day: true)
- create(:message, conversation: conversation, message_type: :outgoing, created_at: 2.minutes.ago)
+ create(:message, conversation: conversation, message_type: :outgoing, created_at: 2.minutes.ago)
- out_of_office_service = double
- allow(MessageTemplates::Template::OutOfOffice).to receive(:new).and_return(out_of_office_service)
- allow(out_of_office_service).to receive(:perform).and_return(true)
+ out_of_office_service = double
+ allow(MessageTemplates::Template::OutOfOffice).to receive(:new).and_return(out_of_office_service)
+ allow(out_of_office_service).to receive(:perform).and_return(true)
- create(:message, conversation: conversation)
+ create(:message, conversation: conversation)
- expect(MessageTemplates::Template::OutOfOffice).not_to have_received(:new)
- expect(out_of_office_service).not_to have_received(:perform)
+ expect(MessageTemplates::Template::OutOfOffice).not_to have_received(:new)
+ expect(out_of_office_service).not_to have_received(:perform)
+ end
+
+ it 'ignores private note and calls ::MessageTemplates::Template::OutOfOffice' do
+ contact = create(:contact)
+ conversation = create(:conversation, contact: contact)
+
+ conversation.inbox.update(working_hours_enabled: true, out_of_office_message: 'We are out of office')
+ conversation.inbox.working_hours.today.update!(closed_all_day: true)
+
+ create(:message, conversation: conversation, private: true, message_type: :outgoing, created_at: 2.minutes.ago)
+
+ out_of_office_service = double
+ allow(MessageTemplates::Template::OutOfOffice).to receive(:new).and_return(out_of_office_service)
+ allow(out_of_office_service).to receive(:perform).and_return(true)
+
+ create(:message, conversation: conversation)
+
+ expect(MessageTemplates::Template::OutOfOffice).to have_received(:new).with(conversation: conversation)
+ expect(out_of_office_service).to have_received(:perform)
+ end
end
it 'will not calls ::MessageTemplates::Template::OutOfOffice when outgoing message' do
diff --git a/spec/services/message_templates/template/csat_survey_spec.rb b/spec/services/message_templates/template/csat_survey_spec.rb
index dae44ca3e..a2cae684b 100644
--- a/spec/services/message_templates/template/csat_survey_spec.rb
+++ b/spec/services/message_templates/template/csat_survey_spec.rb
@@ -1,13 +1,100 @@
require 'rails_helper'
describe MessageTemplates::Template::CsatSurvey do
- context 'when this hook is called' do
- let(:conversation) { create(:conversation) }
+ let(:account) { create(:account) }
+ let(:inbox) { create(:inbox, account: account) }
+ let(:conversation) { create(:conversation, account: account, inbox: inbox) }
+ let(:service) { described_class.new(conversation: conversation) }
- it 'creates the out of office messages' do
- described_class.new(conversation: conversation).perform
- expect(conversation.messages.template.count).to eq(1)
- expect(conversation.messages.template.first.content_type).to eq('input_csat')
+ describe '#perform' do
+ context 'when no survey rules are configured' do
+ it 'creates a CSAT survey message' do
+ inbox.update(csat_config: {})
+
+ service.perform
+
+ expect(conversation.messages.template.count).to eq(1)
+ expect(conversation.messages.template.first.content_type).to eq('input_csat')
+ end
+ end
+ end
+
+ describe '#perform with contains operator' do
+ let(:csat_config) do
+ {
+ 'display_type' => 'emoji',
+ 'message' => 'Please rate your experience',
+ 'survey_rules' => {
+ 'operator' => 'contains',
+ 'values' => %w[support help]
+ }
+ }
+ end
+
+ before do
+ inbox.update(csat_config: csat_config)
+ end
+
+ context 'when conversation has matching labels' do
+ it 'creates a CSAT survey message' do
+ conversation.update(label_list: %w[support urgent])
+
+ service.perform
+
+ expect(conversation.messages.template.count).to eq(1)
+ message = conversation.messages.template.first
+ expect(message.content_type).to eq('input_csat')
+ expect(message.content).to eq('Please rate your experience')
+ expect(message.content_attributes['display_type']).to eq('emoji')
+ end
+ end
+
+ context 'when conversation has no matching labels' do
+ it 'does not create a CSAT survey message' do
+ conversation.update(label_list: %w[billing-support payment])
+
+ service.perform
+
+ expect(conversation.messages.template.count).to eq(0)
+ end
+ end
+ end
+
+ describe '#perform with does_not_contain operator' do
+ let(:csat_config) do
+ {
+ 'display_type' => 'emoji',
+ 'message' => 'Please rate your experience',
+ 'survey_rules' => {
+ 'operator' => 'does_not_contain',
+ 'values' => %w[support help]
+ }
+ }
+ end
+
+ before do
+ inbox.update(csat_config: csat_config)
+ end
+
+ context 'when conversation does not have matching labels' do
+ it 'creates a CSAT survey message' do
+ conversation.update(label_list: %w[billing payment])
+
+ service.perform
+
+ expect(conversation.messages.template.count).to eq(1)
+ expect(conversation.messages.template.first.content_type).to eq('input_csat')
+ end
+ end
+
+ context 'when conversation has matching labels' do
+ it 'does not create a CSAT survey message' do
+ conversation.update(label_list: %w[support urgent])
+
+ service.perform
+
+ expect(conversation.messages.template.count).to eq(0)
+ end
end
end
end
diff --git a/spec/services/twilio/incoming_message_service_spec.rb b/spec/services/twilio/incoming_message_service_spec.rb
index 5f4dcec69..c8812e45d 100644
--- a/spec/services/twilio/incoming_message_service_spec.rb
+++ b/spec/services/twilio/incoming_message_service_spec.rb
@@ -173,7 +173,7 @@ describe Twilio::IncomingMessageService do
context 'when a message with an attachment is received' do
before do
stub_request(:get, 'https://chatwoot-assets.local/sample.png')
- .to_return(status: 200, body: 'image data', headers: {})
+ .to_return(status: 200, body: 'image data', headers: { 'Content-Type' => 'image/png' })
end
let(:params_with_attachment) do
@@ -203,7 +203,7 @@ describe Twilio::IncomingMessageService do
.to_raise(Down::Error.new('Download error'))
stub_request(:get, 'https://chatwoot-assets.local/sample.png')
- .to_return(status: 200, body: 'image data', headers: {})
+ .to_return(status: 200, body: 'image data', headers: { 'Content-Type' => 'image/png' })
end
let(:params_with_attachment_error) do
@@ -229,5 +229,36 @@ describe Twilio::IncomingMessageService do
expect(conversation.reload.messages.last.attachments.first.file_type).to eq('image')
end
end
+
+ context 'when a message with multiple attachments is received' do
+ before do
+ stub_request(:get, 'https://chatwoot-assets.local/sample.png')
+ .to_return(status: 200, body: 'image data 1', headers: { 'Content-Type' => 'image/png' })
+ stub_request(:get, 'https://chatwoot-assets.local/sample.jpg')
+ .to_return(status: 200, body: 'image data 2', headers: { 'Content-Type' => 'image/jpeg' })
+ end
+
+ let(:params_with_multiple_attachments) do
+ {
+ SmsSid: 'SMxx',
+ From: '+12345',
+ AccountSid: 'ACxxx',
+ MessagingServiceSid: twilio_channel.messaging_service_sid,
+ Body: 'testing multiple media',
+ NumMedia: '2',
+ MediaContentType0: 'image/png',
+ MediaUrl0: 'https://chatwoot-assets.local/sample.png',
+ MediaContentType1: 'image/jpeg',
+ MediaUrl1: 'https://chatwoot-assets.local/sample.jpg'
+ }
+ end
+
+ it 'creates a new message with multiple media attachments in existing conversation' do
+ described_class.new(params: params_with_multiple_attachments).perform
+ expect(conversation.reload.messages.last.content).to eq('testing multiple media')
+ expect(conversation.reload.messages.last.attachments.count).to eq(2)
+ expect(conversation.reload.messages.last.attachments.map(&:file_type)).to contain_exactly('image', 'image')
+ end
+ end
end
end
diff --git a/swagger/definitions/error/bad_request.yml b/swagger/definitions/error/bad_request.yml
index b6facb361..f103edcb5 100644
--- a/swagger/definitions/error/bad_request.yml
+++ b/swagger/definitions/error/bad_request.yml
@@ -6,4 +6,4 @@ properties:
errors:
type: array
items:
- $ref: '#/definitions/request_error'
+ $ref: '#/components/schemas/request_error'
diff --git a/swagger/definitions/index.yml b/swagger/definitions/index.yml
index d11ec7988..57e10e2dd 100644
--- a/swagger/definitions/index.yml
+++ b/swagger/definitions/index.yml
@@ -1,13 +1,11 @@
-## ---------- ERRORS ------------- ##
+## ---------- ERRORS -------------- ##
## -------------------------------- ##
bad_request_error:
$ref: ./error/bad_request.yml
request_error:
$ref: ./error/request.yml
-
-
-## ---------- RESOURCE ------------- ##
+## ---------- RESOURCE ------------ ##
## -------------------------------- ##
generic_id:
@@ -18,12 +16,20 @@ custom_attribute:
$ref: ./resource/custom_attribute.yml
automation_rule:
$ref: ./resource/automation_rule.yml
+automation_rule_item:
+ $ref: ./resource/automation_rule_item.yml
portal:
$ref: ./resource/portal.yml
-category:
- $ref: ./resource/category.yml
-article:
- $ref: ./resource/article.yml
+portal_single:
+ $ref: ./resource/portal_single.yml
+portal_config:
+ $ref: ./resource/portal_config.yml
+portal_logo:
+ $ref: ./resource/portal_logo.yml
+portal_meta:
+ $ref: ./resource/portal_meta.yml
+portal_item:
+ $ref: ./resource/portal_item.yml
category:
$ref: ./resource/category.yml
article:
@@ -40,6 +46,8 @@ agent:
$ref: ./resource/agent.yml
inbox:
$ref: ./resource/inbox.yml
+inbox_contact:
+ $ref: ./resource/inbox_contact.yml
agent_bot:
$ref: ./resource/agent_bot.yml
contact_inboxes:
@@ -52,6 +60,8 @@ webhook:
$ref: ./resource/webhook.yml
account:
$ref: ./resource/account.yml
+account_user:
+ $ref: ./resource/account_user.yml
platform_account:
$ref: ./resource/platform_account.yml
team:
@@ -71,13 +81,18 @@ public_message:
public_inbox:
$ref: ./resource/public/inbox.yml
-
-## ---------- REQUEST------------- ##
+## ---------- REQUEST ------------- ##
## -------------------------------- ##
account_create_update_payload:
$ref: ./request/account/create_update_payload.yml
+account_user_create_update_payload:
+ $ref: ./request/account_user/create_update_payload.yml
+
+platform_agent_bot_create_update_payload:
+ $ref: ./request/platform/agent_bot/create_update_payload.yml
+
agent_bot_create_update_payload:
$ref: ./request/agent_bot/create_update_payload.yml
@@ -89,21 +104,36 @@ canned_response_create_update_payload:
custom_attribute_create_update_payload:
$ref: ./request/custom_attribute/create_update_payload.yml
-## contact
-contact_create:
- $ref: ./request/contact/create.yml
-contact_update:
- $ref: ./request/contact/update.yml
-## conversation
-conversation_message_create:
- $ref: ./request/conversation/create_message.yml
+## Agent
+agent_create_payload:
+ $ref: ./request/agent/create_payload.yml
+agent_update_payload:
+ $ref: ./request/agent/update_payload.yml
-# Team request Payload
+## Contact
+contact_create_payload:
+ $ref: ./request/contact/create_payload.yml
+contact_update_payload:
+ $ref: ./request/contact/update_payload.yml
+
+## Conversation
+conversation_create_payload:
+ $ref: ./request/conversation/create_payload.yml
+conversation_message_create_payload:
+ $ref: ./request/conversation/create_message_payload.yml
+
+# Inbox
+inbox_create_payload:
+ $ref: ./request/inbox/create_payload.yml
+inbox_update_payload:
+ $ref: ./request/inbox/update_payload.yml
+
+# Team
team_create_update_payload:
$ref: ./request/team/create_update_payload.yml
-# Custom Filter request Payload
+# Custom Filter
custom_filter_create_update_payload:
$ref: ./request/custom_filter/create_update_payload.yml
@@ -128,7 +158,6 @@ category_create_update_payload:
article_create_update_payload:
$ref: ./request/portal/article_create_update_payload.yml
-
## public requests
public_contact_create_update_payload:
$ref: ./request/public/contact/create_update_payload.yml
@@ -141,37 +170,36 @@ public_message_update_payload:
public_conversation_create_payload:
$ref: ./request/public/conversation/create_payload.yml
-## ---------- RESPONSE ------------- ##
+## ---------- RESPONSE ------------ ##
## -------------------------------- ##
-## contact
+## Contact
extended_contact:
allOf:
- - $ref: '#/definitions/contact'
+ - $ref: '#/components/schemas/contact'
- $ref: ./resource/extension/contact/show.yml
contact_base:
allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/contact'
+ - $ref: '#/components/schemas/generic_id'
+ - $ref: '#/components/schemas/contact'
contact_list:
type: array
description: 'array of contacts'
items:
allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/contact'
+ - $ref: '#/components/schemas/contact'
contact_conversations:
type: array
description: 'array of conversations'
items:
allOf:
- - $ref: '#/definitions/conversation'
+ - $ref: '#/components/schemas/conversation'
- $ref: ./resource/extension/contact/conversation.yml
- $ref: ./resource/extension/conversation/with_display_id.yml
contact_labels:
$ref: ./resource/extension/contact/labels.yml
-## conversation
+## Conversation
conversation_list:
$ref: ./resource/extension/conversation/list.yml
conversation_show:
@@ -181,9 +209,33 @@ conversation_status_toggle:
conversation_labels:
$ref: ./resource/extension/conversation/labels.yml
-
-## report
+## Report
account_summary:
$ref: './resource/reports/summary.yml'
agent_conversation_metrics:
$ref: './resource/reports/conversation/agent.yml'
+
+contact_detail:
+ $ref: ./resource/contact_detail.yml
+message_detailed:
+ $ref: ./resource/message_detailed.yml
+conversation_meta:
+ $ref: ./resource/conversation_meta.yml
+conversation_messages:
+ $ref: ./resource/conversation_messages.yml
+contact_meta:
+ $ref: ./resource/contact_meta.yml
+contact_inbox:
+ $ref: ./resource/contact_inbox.yml
+contact_list_item:
+ $ref: ./resource/contact_list_item.yml
+contacts_list_response:
+ $ref: ./resource/contacts_list_response.yml
+contact_show_response:
+ $ref: ./resource/contact_show_response.yml
+contact_conversation_message:
+ $ref: ./resource/contact_conversation_message.yml
+contact_conversations_response:
+ $ref: ./resource/contact_conversations_response.yml
+contactable_inboxes_response:
+ $ref: ./resource/contactable_inboxes_response.yml
diff --git a/swagger/definitions/request/account/create_update_payload.yml b/swagger/definitions/request/account/create_update_payload.yml
index 63c0eed13..b11b82373 100644
--- a/swagger/definitions/request/account/create_update_payload.yml
+++ b/swagger/definitions/request/account/create_update_payload.yml
@@ -3,3 +3,29 @@ properties:
name:
type: string
description: Name of the account
+ example: 'My Account'
+ locale:
+ type: string
+ description: The locale of the account
+ example: 'en'
+ domain:
+ type: string
+ description: The domain of the account
+ example: 'example.com'
+ support_email:
+ type: string
+ description: The support email of the account
+ example: 'support@example.com'
+ status:
+ type: string
+ enum: ['active', 'suspended']
+ description: The status of the account
+ example: 'active'
+ limits:
+ type: object
+ description: The limits of the account
+ example: {}
+ custom_attributes:
+ type: object
+ description: The custom attributes of the account
+ example: {}
diff --git a/swagger/definitions/request/account_user/create_update_payload.yml b/swagger/definitions/request/account_user/create_update_payload.yml
new file mode 100644
index 000000000..d2982c4cf
--- /dev/null
+++ b/swagger/definitions/request/account_user/create_update_payload.yml
@@ -0,0 +1,13 @@
+type: object
+required:
+ - user_id
+ - role
+properties:
+ user_id:
+ type: integer
+ description: The ID of the user
+ example: 1
+ role:
+ type: string
+ description: whether user is an administrator or agent
+ example: administrator
diff --git a/swagger/definitions/request/agent/create_payload.yml b/swagger/definitions/request/agent/create_payload.yml
new file mode 100644
index 000000000..1daeae83a
--- /dev/null
+++ b/swagger/definitions/request/agent/create_payload.yml
@@ -0,0 +1,28 @@
+type: object
+required:
+ - name
+ - email
+ - role
+properties:
+ name:
+ type: string
+ description: Full Name of the agent
+ example: 'John Doe'
+ email:
+ type: string
+ description: Email of the Agent
+ example: 'john.doe@acme.inc'
+ role:
+ type: string
+ enum: ['agent', 'administrator']
+ description: Whether its administrator or agent
+ example: 'agent'
+ availability_status:
+ type: string
+ enum: ['available', 'busy', 'offline']
+ description: The availability setting of the agent.
+ example: 'available'
+ auto_offline:
+ type: boolean
+ description: Whether the availability status of agent is configured to go offline automatically when away.
+ example: true
diff --git a/swagger/definitions/request/agent/update_payload.yml b/swagger/definitions/request/agent/update_payload.yml
new file mode 100644
index 000000000..fc8d1457d
--- /dev/null
+++ b/swagger/definitions/request/agent/update_payload.yml
@@ -0,0 +1,18 @@
+type: object
+required:
+ - role
+properties:
+ role:
+ type: string
+ enum: ['agent', 'administrator']
+ description: Whether its administrator or agent
+ example: 'agent'
+ availability_status:
+ type: string
+ enum: ['available', 'busy', 'offline']
+ description: The availability status of the agent.
+ example: 'available'
+ auto_offline:
+ type: boolean
+ description: Whether the availability status of agent is configured to go offline automatically when away.
+ example: true
diff --git a/swagger/definitions/request/agent_bot/create_update_payload.yml b/swagger/definitions/request/agent_bot/create_update_payload.yml
index 4dc74bea3..4a95b42bf 100644
--- a/swagger/definitions/request/agent_bot/create_update_payload.yml
+++ b/swagger/definitions/request/agent_bot/create_update_payload.yml
@@ -3,9 +3,28 @@ properties:
name:
type: string
description: The name of the agent bot
+ example: 'My Agent Bot'
description:
type: string
- description: The description about the agent bot
+ description: The description of the agent bot
+ example: 'This is a sample agent bot'
outgoing_url:
type: string
description: The webhook URL for the bot
+ example: 'https://example.com/webhook'
+ avatar:
+ type: string
+ format: binary
+ description: Send the form data with the avatar image binary or use the avatar_url
+ avatar_url:
+ type: string
+ description: The url to a jpeg, png file for the agent bot avatar
+ example: https://example.com/avatar.png
+ bot_type:
+ type: integer
+ description: The type of the bot (0 for webhook)
+ example: 0
+ bot_config:
+ type: object
+ description: The configuration for the bot
+ example: {}
diff --git a/swagger/definitions/request/automation_rule/create_update_payload.yml b/swagger/definitions/request/automation_rule/create_update_payload.yml
index 20d362e48..091fa2aaa 100644
--- a/swagger/definitions/request/automation_rule/create_update_payload.yml
+++ b/swagger/definitions/request/automation_rule/create_update_payload.yml
@@ -36,6 +36,6 @@ properties:
example:
attribute_key: content
filter_operator: contains
- query_operator: nil
+ query_operator: OR
values:
- help
diff --git a/swagger/definitions/request/canned_response/create_update_payload.yml b/swagger/definitions/request/canned_response/create_update_payload.yml
index ef6f7f74a..3673b4798 100644
--- a/swagger/definitions/request/canned_response/create_update_payload.yml
+++ b/swagger/definitions/request/canned_response/create_update_payload.yml
@@ -3,6 +3,8 @@ properties:
content:
type: string
description: Message content for canned response
+ example: 'Hello, {{contact.name}}! Welcome to our service.'
short_code:
type: string
description: Short Code for quick access of the canned response
+ example: 'welcome'
diff --git a/swagger/definitions/request/contact/create_payload.yml b/swagger/definitions/request/contact/create_payload.yml
new file mode 100644
index 000000000..7f74e501c
--- /dev/null
+++ b/swagger/definitions/request/contact/create_payload.yml
@@ -0,0 +1,44 @@
+type: object
+required:
+ - inbox_id
+properties:
+ inbox_id:
+ type: number
+ description: ID of the inbox to which the contact belongs
+ example: 1
+ name:
+ type: string
+ description: name of the contact
+ example: Alice
+ email:
+ type: string
+ description: email of the contact
+ example: alice@acme.inc
+ blocked:
+ type: boolean
+ description: whether the contact is blocked or not
+ example: false
+ phone_number:
+ type: string
+ description: phone number of the contact
+ example: '+123456789'
+ avatar:
+ type: string
+ format: binary
+ description: Send the form data with the avatar image binary or use the avatar_url
+ avatar_url:
+ type: string
+ description: The url to a jpeg, png file for the contact avatar
+ example: https://example.com/avatar.png
+ identifier:
+ type: string
+ description: A unique identifier for the contact in external system
+ example: '1234567890'
+ additional_attributes:
+ type: object
+ description: An object where you can store additional attributes for contact. example {"type":"customer", "age":30}
+ example: { 'type': 'customer', 'age': 30 }
+ custom_attributes:
+ type: object
+ description: An object where you can store custom attributes for contact. example {"type":"customer", "age":30}, this should have a valid custom attribute definition.
+ example: {}
diff --git a/swagger/definitions/request/contact/update.yml b/swagger/definitions/request/contact/update.yml
deleted file mode 100644
index 4a12672a3..000000000
--- a/swagger/definitions/request/contact/update.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-type: object
-properties:
- name:
- type: string
- description: name of the contact
- email:
- type: string
- description: email of the contact
- phone_number:
- type: string
- description: phone number of the contact
- avatar:
- type: string
- format: binary
- description: Send the form data with the avatar image binary or use the avatar_url
- avatar_url:
- type: string
- description: The url to a jpeg, png file for the contact avatar
- identifier:
- type: string
- description: A unique identifier for the contact in external system
- custom_attributes:
- type: object
- description: An object where you can store custom attributes for contact. example {"type":"customer", "age":30}
-
diff --git a/swagger/definitions/request/contact/create.yml b/swagger/definitions/request/contact/update_payload.yml
similarity index 53%
rename from swagger/definitions/request/contact/create.yml
rename to swagger/definitions/request/contact/update_payload.yml
index 5acbe5f94..99bec3548 100644
--- a/swagger/definitions/request/contact/create.yml
+++ b/swagger/definitions/request/contact/update_payload.yml
@@ -1,18 +1,21 @@
type: object
-required:
- - inbox_id
properties:
- inbox_id:
- type: number
name:
type: string
description: name of the contact
+ example: Alice
email:
type: string
description: email of the contact
+ example: alice@acme.inc
+ blocked:
+ type: boolean
+ description: whether the contact is blocked or not
+ example: false
phone_number:
type: string
description: phone number of the contact
+ example: '+123456789'
avatar:
type: string
format: binary
@@ -20,9 +23,16 @@ properties:
avatar_url:
type: string
description: The url to a jpeg, png file for the contact avatar
+ example: https://example.com/avatar.png
identifier:
type: string
description: A unique identifier for the contact in external system
+ example: '1234567890'
+ additional_attributes:
+ type: object
+ description: An object where you can store additional attributes for contact. example {"type":"customer", "age":30}
+ example: { 'type': 'customer', 'age': 30 }
custom_attributes:
type: object
- description: An object where you can store custom attributes for contact. example {"type":"customer", "age":30}
+ description: An object where you can store custom attributes for contact. example {"type":"customer", "age":30}, this should have a valid custom attribute definition.
+ example: {}
diff --git a/swagger/definitions/request/conversation/create_message.yml b/swagger/definitions/request/conversation/create_message_payload.yml
similarity index 68%
rename from swagger/definitions/request/conversation/create_message.yml
rename to swagger/definitions/request/conversation/create_message_payload.yml
index b3c9b935b..ef1a051c2 100644
--- a/swagger/definitions/request/conversation/create_message.yml
+++ b/swagger/definitions/request/conversation/create_message_payload.yml
@@ -5,20 +5,29 @@ properties:
content:
type: string
description: The content of the message
+ example: 'Hello, how can I help you?'
message_type:
type: string
enum: ['outgoing', 'incoming']
+ description: The type of the message
+ example: 'outgoing'
private:
type: boolean
description: Flag to identify if it is a private note
+ example: false
content_type:
type: string
- enum: ['text', 'input_email', 'cards', 'input_select', 'form' , 'article']
- example: 'cards'
- description: 'if you want to create custom message types'
+ enum: ['text', 'input_email', 'cards', 'input_select', 'form', 'article']
+ description: Content type of the message
+ example: 'text'
content_attributes:
type: object
- description: attributes based on your content type
+ description: Attributes based on the content type
+ example: {}
+ campaign_id:
+ type: integer
+ description: The campaign id to which the message belongs
+ example: 1
template_params:
type: object
description: The template params for the message in case of whatsapp Channel
@@ -35,8 +44,8 @@ properties:
type: string
description: Language of the template
example: en_US
- processed_params:
+ processed_params:
type: object
description: The processed param values for template variables in template
- example:
- 1: "Chatwoot"
+ example:
+ 1: 'Chatwoot'
diff --git a/swagger/definitions/request/conversation/create_payload.yml b/swagger/definitions/request/conversation/create_payload.yml
new file mode 100644
index 000000000..c0cc75c46
--- /dev/null
+++ b/swagger/definitions/request/conversation/create_payload.yml
@@ -0,0 +1,79 @@
+type: object
+required:
+ - source_id
+ - inbox_id
+properties:
+ source_id:
+ type: string
+ description: Conversation source id
+ example: '1234567890'
+ inbox_id:
+ type: integer
+ description: 'Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email'
+ example: 1
+ contact_id:
+ type: integer
+ description: Contact Id for which conversation is created
+ example: 1
+ additional_attributes:
+ type: object
+ description: Lets you specify attributes like browser information
+ example:
+ {
+ browser: 'Chrome',
+ browser_version: '89.0.4389.82',
+ os: 'Windows',
+ os_version: '10',
+ }
+ custom_attributes:
+ type: object
+ description: The object to save custom attributes for conversation, accepts custom attributes key and value
+ example: { attribute_key: attribute_value, priority_conversation_number: 3 }
+ status:
+ type: string
+ enum: ['open', 'resolved', 'pending']
+ description: Specify the conversation whether it's pending, open, closed
+ example: open
+ assignee_id:
+ type: integer
+ description: Agent Id for assigning a conversation to an agent
+ example: 1
+ team_id:
+ type: integer
+ description: Team Id for assigning a conversation to a team\
+ example: 1
+ snoozed_until:
+ type: string
+ format: date-time
+ description: Snoozed until date time
+ example: '2030-07-21T17:32:28Z'
+ message:
+ type: object
+ description: The initial message to be sent to the conversation
+ required: ['content']
+ properties:
+ content:
+ type: string
+ description: The content of the message
+ example: 'Hello, how can I help you?'
+ template_params:
+ type: object
+ description: The template params for the message in case of whatsapp Channel
+ properties:
+ name:
+ type: string
+ description: Name of the template
+ example: 'sample_issue_resolution'
+ category:
+ type: string
+ description: Category of the template
+ example: UTILITY
+ language:
+ type: string
+ description: Language of the template
+ example: en_US
+ processed_params:
+ type: object
+ description: The processed param values for template variables in template
+ example:
+ 1: 'Chatwoot'
diff --git a/swagger/definitions/request/custom_attribute/create_update_payload.yml b/swagger/definitions/request/custom_attribute/create_update_payload.yml
index fd368f98c..3ee960559 100644
--- a/swagger/definitions/request/custom_attribute/create_update_payload.yml
+++ b/swagger/definitions/request/custom_attribute/create_update_payload.yml
@@ -3,20 +3,34 @@ properties:
attribute_display_name:
type: string
description: Attribute display name
+ example: 'Custom Attribute'
attribute_display_type:
type: integer
description: Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)
+ example: 0
attribute_description:
type: string
description: Attribute description
+ example: 'This is a custom attribute'
attribute_key:
type: string
description: Attribute unique key value
+ example: 'custom_attribute'
attribute_values:
type: array
description: Attribute values
items:
type: string
+ example: ['value1', 'value2']
attribute_model:
type: integer
description: Attribute type(conversation_attribute- 0, contact_attribute- 1)
+ example: 0
+ regex_pattern:
+ type: string
+ description: Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).
+ example: '^[a-zA-Z0-9]+$'
+ regex_cue:
+ type: string
+ description: Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.
+ example: 'Please enter a valid value'
diff --git a/swagger/definitions/request/custom_filter/create_update_payload.yml b/swagger/definitions/request/custom_filter/create_update_payload.yml
index 86a6cd8c1..c046f74df 100644
--- a/swagger/definitions/request/custom_filter/create_update_payload.yml
+++ b/swagger/definitions/request/custom_filter/create_update_payload.yml
@@ -3,10 +3,13 @@ properties:
name:
type: string
description: The name of the custom filter
+ example: 'My Custom Filter'
type:
type: string
- enum: ["conversation", "contact", "report"]
+ enum: ['conversation', 'contact', 'report']
description: The description about the custom filter
+ example: 'conversation'
query:
type: object
description: A query that needs to be saved as a custom filter
+ example: {}
diff --git a/swagger/definitions/request/inbox/create_payload.yml b/swagger/definitions/request/inbox/create_payload.yml
new file mode 100644
index 000000000..59584054c
--- /dev/null
+++ b/swagger/definitions/request/inbox/create_payload.yml
@@ -0,0 +1,88 @@
+type: object
+properties:
+ name:
+ type: string
+ description: The name of the inbox
+ example: 'Support'
+ avatar:
+ type: string
+ format: binary
+ description: Image file for avatar
+ greeting_enabled:
+ type: boolean
+ description: Enable greeting message
+ example: true
+ greeting_message:
+ type: string
+ description: Greeting message to be displayed on the widget
+ example: Hello, how can I help you?
+ enable_email_collect:
+ type: boolean
+ description: Enable email collection
+ example: true
+ csat_survey_enabled:
+ type: boolean
+ description: Enable CSAT survey
+ example: true
+ enable_auto_assignment:
+ type: boolean
+ description: Enable Auto Assignment
+ example: true
+ working_hours_enabled:
+ type: boolean
+ description: Enable working hours
+ example: true
+ out_of_office_message:
+ type: string
+ description: Out of office message to be displayed on the widget
+ example: We are currently out of office. Please leave a message and we will get back to you.
+ timezone:
+ type: string
+ description: Timezone of the inbox
+ example: 'America/New_York'
+ allow_messages_after_resolved:
+ type: boolean
+ description: Allow messages after conversation is resolved
+ example: true
+ lock_to_single_conversation:
+ type: boolean
+ description: Lock to single conversation
+ example: true
+ portal_id:
+ type: integer
+ description: Id of the help center portal to attach to the inbox
+ example: 1
+ sender_name_type:
+ type: string
+ description: Sender name type for the inbox
+ enum: ['friendly', 'professional']
+ example: 'friendly'
+ business_name:
+ type: string
+ description: Business name for the inbox
+ example: 'My Business'
+ channel:
+ type: object
+ properties:
+ type:
+ type: string
+ description: Type of the channel
+ enum:
+ ['web_widget', 'api', 'email', 'line', 'telegram', 'whatsapp', 'sms']
+ example: web_widget
+ website_url:
+ type: string
+ description: URL at which the widget will be loaded
+ example: 'https://example.com'
+ welcome_title:
+ type: string
+ description: Welcome title to be displayed on the widget
+ example: 'Welcome to our support'
+ welcome_tagline:
+ type: string
+ description: Welcome tagline to be displayed on the widget
+ example: 'We are here to help you'
+ widget_color:
+ type: string
+ description: A Hex-color string used to customize the widget
+ example: '#FF5733'
diff --git a/swagger/definitions/request/inbox/update_payload.yml b/swagger/definitions/request/inbox/update_payload.yml
new file mode 100644
index 000000000..f625fc5b8
--- /dev/null
+++ b/swagger/definitions/request/inbox/update_payload.yml
@@ -0,0 +1,82 @@
+type: object
+properties:
+ name:
+ type: string
+ description: The name of the inbox
+ example: 'Support'
+ avatar:
+ type: string
+ format: binary
+ description: Image file for avatar
+ greeting_enabled:
+ type: boolean
+ description: Enable greeting message
+ example: true
+ greeting_message:
+ type: string
+ description: Greeting message to be displayed on the widget
+ example: Hello, how can I help you?
+ enable_email_collect:
+ type: boolean
+ description: Enable email collection
+ example: true
+ csat_survey_enabled:
+ type: boolean
+ description: Enable CSAT survey
+ example: true
+ enable_auto_assignment:
+ type: boolean
+ description: Enable Auto Assignment
+ example: true
+ working_hours_enabled:
+ type: boolean
+ description: Enable working hours
+ example: true
+ out_of_office_message:
+ type: string
+ description: Out of office message to be displayed on the widget
+ example: We are currently out of office. Please leave a message and we will get back to you.
+ timezone:
+ type: string
+ description: Timezone of the inbox
+ example: 'America/New_York'
+ allow_messages_after_resolved:
+ type: boolean
+ description: Allow messages after conversation is resolved
+ example: true
+ lock_to_single_conversation:
+ type: boolean
+ description: Lock to single conversation
+ example: true
+ portal_id:
+ type: integer
+ description: Id of the help center portal to attach to the inbox
+ example: 1
+ sender_name_type:
+ type: string
+ description: Sender name type for the inbox
+ enum: ['friendly', 'professional']
+ example: 'friendly'
+ business_name:
+ type: string
+ description: Business name for the inbox
+ example: 'My Business'
+ channel:
+ type: object
+ properties:
+ website_url:
+ type: string
+ description: URL at which the widget will be loaded
+ example: 'https://example.com'
+ welcome_title:
+ type: string
+ description: Welcome title to be displayed on the widget
+ example: 'Welcome to our support'
+ welcome_tagline:
+ type: string
+ description: Welcome tagline to be displayed on the widget
+ example: 'We are here to help you'
+ widget_color:
+ type: string
+ description: A Hex-color string used to customize the widget
+ example: '#FF5733'
diff --git a/swagger/definitions/request/integrations/hook_create_payload.yml b/swagger/definitions/request/integrations/hook_create_payload.yml
index d1bf518d8..71da8106b 100644
--- a/swagger/definitions/request/integrations/hook_create_payload.yml
+++ b/swagger/definitions/request/integrations/hook_create_payload.yml
@@ -1,11 +1,18 @@
type: object
properties:
app_id:
- type: string
+ type: integer
description: The ID of app for which integration hook is being created
+ example: 1
inbox_id:
- type: string
+ type: integer
description: The inbox ID, if the hook is an inbox hook
+ example: 1
+ status:
+ type: integer
+ description: The status of the integration (0 for inactive, 1 for active)
+ example: 1
settings:
type: object
description: The settings required by the integration
+ example: {}
diff --git a/swagger/definitions/request/integrations/hook_update_payload.yml b/swagger/definitions/request/integrations/hook_update_payload.yml
index 5b91024db..4444dee81 100644
--- a/swagger/definitions/request/integrations/hook_update_payload.yml
+++ b/swagger/definitions/request/integrations/hook_update_payload.yml
@@ -1,5 +1,10 @@
type: object
properties:
+ status:
+ type: integer
+ description: The status of the integration (0 for inactive, 1 for active)
+ example: 1
settings:
type: object
description: The settings required by the integration
+ example: {}
diff --git a/swagger/definitions/request/platform/agent_bot/create_update_payload.yml b/swagger/definitions/request/platform/agent_bot/create_update_payload.yml
new file mode 100644
index 000000000..a258e28a6
--- /dev/null
+++ b/swagger/definitions/request/platform/agent_bot/create_update_payload.yml
@@ -0,0 +1,26 @@
+type: object
+properties:
+ name:
+ type: string
+ description: The name of the agent bot
+ example: 'My Agent Bot'
+ description:
+ type: string
+ description: The description of the agent bot
+ example: 'This is a sample agent bot'
+ outgoing_url:
+ type: string
+ description: The webhook URL for the bot
+ example: 'https://example.com/webhook'
+ account_id:
+ type: integer
+ description: The account ID to associate the agent bot with
+ example: 1
+ avatar:
+ type: string
+ format: binary
+ description: Send the form data with the avatar image binary or use the avatar_url
+ avatar_url:
+ type: string
+ description: The url to a jpeg, png file for the agent bot avatar
+ example: https://example.com/avatar.png
diff --git a/swagger/definitions/request/portal/article_create_update_payload.yml b/swagger/definitions/request/portal/article_create_update_payload.yml
index cddac1d1d..311d478c3 100644
--- a/swagger/definitions/request/portal/article_create_update_payload.yml
+++ b/swagger/definitions/request/portal/article_create_update_payload.yml
@@ -1,34 +1,51 @@
type: object
properties:
- content:
+ title:
type: string
- description: The text content.
- meta:
- type: object
- description: Use for search
- example: { tags: ['article_name'], title: 'article title', description: 'article description' }
+ description: The title of the article
+ example: 'Article Title'
+ slug:
+ type: string
+ description: The slug of the article
+ example: 'article-title'
position:
type: integer
description: article position in category
- status:
- type: integer
- example: ['draft', 'published', 'archived']
- title:
+ example: 1
+ content:
type: string
- slug:
+ description: The text content.
+ example: 'This is the content of the article'
+ description:
type: string
- views:
- type: integer
- portal_id:
- type: integer
- account_id:
- type: integer
- author_id:
- type: integer
+ description: The description of the article
+ example: 'This is the description of the article'
category_id:
type: integer
- folder_id:
+ description: The category id of the article
+ example: 1
+ author_id:
type: integer
+ description: The author agent id of the article
+ example: 1
associated_article_id:
type: integer
description: To associate similar articles to each other, e.g to provide the link for the reference.
+ example: 2
+ status:
+ type: integer
+ description: The status of the article. 0 for draft, 1 for published, 2 for archived
+ example: 1
+ locale:
+ type: string
+ description: The locale of the article
+ example: 'en'
+ meta:
+ type: object
+ description: Use for search
+ example:
+ {
+ tags: ['article_name'],
+ title: 'article title',
+ description: 'article description',
+ }
diff --git a/swagger/definitions/request/portal/category_create_update_payload.yml b/swagger/definitions/request/portal/category_create_update_payload.yml
index 0d1ce5c8f..67bb650cb 100644
--- a/swagger/definitions/request/portal/category_create_update_payload.yml
+++ b/swagger/definitions/request/portal/category_create_update_payload.yml
@@ -1,28 +1,34 @@
type: object
properties:
- description:
- type: string
- description: Category description
- locale:
- type: string
- description: Category locale
- example: en/es
name:
type: string
- description: Category name
- slug:
+ description: The name of the category
+ example: 'Category Name'
+ description:
type: string
- description: Category slug
+ description: A description for the category
+ example: 'Category description'
position:
type: integer
description: Category position in the portal list to sort
- portal_id:
- type: integer
- account_id:
- type: integer
- associated_category_id:
- type: integer
- description: To associate similar categories to each other, e.g same category of product documentation in different languages
+ example: 1
+ slug:
+ type: string
+ description: The category slug used in the URL
+ example: 'category-name'
+ locale:
+ type: string
+ description: The locale of the category
+ example: en
+ icon:
+ type: string
+ description: The icon of the category as a string (emoji)
+ example: '📚'
parent_category_id:
type: integer
description: To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.
+ example: 1
+ associated_category_id:
+ type: integer
+ description: To associate similar categories to each other, e.g same category of product documentation in different languages
+ example: 2
diff --git a/swagger/definitions/request/portal/portal_create_update_payload.yml b/swagger/definitions/request/portal/portal_create_update_payload.yml
index d1e82aaf4..56feadbda 100644
--- a/swagger/definitions/request/portal/portal_create_update_payload.yml
+++ b/swagger/definitions/request/portal/portal_create_update_payload.yml
@@ -1,20 +1,13 @@
type: object
properties:
- archived:
- type: boolean
- description: Status to check if portal is live
color:
type: string
- description: Header color for help-center
- example: add color HEX string, "#fffff"
- config:
- type: object
- description: Configuration about supporting locales
- example: { allowed_locales: ['en', 'es'], default_locale: 'en' }
+ description: Header color for help-center in hex format
+ example: '#FFFFFF'
custom_domain:
type: string
- description: Custom domain to display help center.
- example: https://chatwoot.help/.
+ description: Custom domain to display help center.
+ example: chatwoot.help
header_text:
type: string
description: Help center header
@@ -26,11 +19,20 @@ properties:
name:
type: string
description: Name for the portal
- slug:
- type: string
- description: Slug for the portal to display in link
+ example: Handbook
page_title:
type: string
description: Page title for the portal
- account_id:
- type: integer
+ example: Handbook
+ slug:
+ type: string
+ description: Slug for the portal to display in link
+ example: handbook
+ archived:
+ type: boolean
+ description: Status to check if portal is live
+ example: false
+ config:
+ type: object
+ description: Configuration about supporting locales
+ example: { allowed_locales: ['en', 'es'], default_locale: 'en' }
diff --git a/swagger/definitions/request/public/contact/create_update_payload.yml b/swagger/definitions/request/public/contact/create_update_payload.yml
index 48c6e4550..f4cacafe8 100644
--- a/swagger/definitions/request/public/contact/create_update_payload.yml
+++ b/swagger/definitions/request/public/contact/create_update_payload.yml
@@ -1,24 +1,30 @@
-
type: object
properties:
identifier:
type: string
description: External identifier of the contact
+ example: '1234567890'
identifier_hash:
type: string
description: Identifier hash prepared for HMAC authentication
+ example: 'e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9'
email:
type: string
description: Email of the contact
+ example: alice@acme.inc
name:
type: string
description: Name of the contact
+ example: Alice
phone_number:
type: string
description: Phone number of the contact
- avatar_url:
+ example: '+123456789'
+ avatar:
type: string
- description: The url to a jpeg, png file for the user avatar
+ format: binary
+ description: Send the form data with the avatar image binary or use the avatar_url
custom_attributes:
type: object
- description: Custom attributes of the customer
\ No newline at end of file
+ description: Custom attributes of the customer
+ example: {}
diff --git a/swagger/definitions/request/public/conversation/create_payload.yml b/swagger/definitions/request/public/conversation/create_payload.yml
index 37cd9f7ef..e81d1adf5 100644
--- a/swagger/definitions/request/public/conversation/create_payload.yml
+++ b/swagger/definitions/request/public/conversation/create_payload.yml
@@ -3,3 +3,4 @@ properties:
custom_attributes:
type: object
description: Custom attributes of the conversation
+ example: {}
diff --git a/swagger/definitions/request/public/message/create_payload.yml b/swagger/definitions/request/public/message/create_payload.yml
index 2935b4abb..6ae920255 100644
--- a/swagger/definitions/request/public/message/create_payload.yml
+++ b/swagger/definitions/request/public/message/create_payload.yml
@@ -1,10 +1,10 @@
-
type: object
properties:
content:
type: string
description: Content for the message
+ example: 'Hello, how can I help you?'
echo_id:
type: string
description: Temporary identifier which will be passed back via websockets
-
\ No newline at end of file
+ example: '1234567890'
diff --git a/swagger/definitions/request/public/message/update_payload.yml b/swagger/definitions/request/public/message/update_payload.yml
index 10926faa1..c739aa34a 100644
--- a/swagger/definitions/request/public/message/update_payload.yml
+++ b/swagger/definitions/request/public/message/update_payload.yml
@@ -1,6 +1,30 @@
-
type: object
properties:
submitted_values:
type: object
- description: Replies to the Bot Message Types
\ No newline at end of file
+ description: Replies to the Bot Message Types
+ properties:
+ name:
+ type: string
+ description: The name of the submiitted value
+ example: 'My Name'
+ title:
+ type: string
+ description: The title of the submitted value
+ example: 'My Title'
+ value:
+ type: string
+ description: The value of the submitted value
+ example: 'value'
+ csat_survey_response:
+ type: object
+ description: The CSAT survey response
+ properties:
+ feedback_message:
+ type: string
+ description: The feedback message of the CSAT survey response
+ example: 'Great service!'
+ rating:
+ type: integer
+ description: The rating of the CSAT survey response
+ example: 5
diff --git a/swagger/definitions/request/team/create_update_payload.yml b/swagger/definitions/request/team/create_update_payload.yml
index f4db1e5d7..77b714269 100644
--- a/swagger/definitions/request/team/create_update_payload.yml
+++ b/swagger/definitions/request/team/create_update_payload.yml
@@ -3,9 +3,12 @@ properties:
name:
type: string
description: The name of the team
+ example: Support Team
description:
type: string
description: The description of the team
+ example: This is a team of support agents
allow_auto_assign:
type: boolean
description: If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team
+ example: true
diff --git a/swagger/definitions/request/user/create_update_payload.yml b/swagger/definitions/request/user/create_update_payload.yml
index e14a25317..1bebdc59c 100644
--- a/swagger/definitions/request/user/create_update_payload.yml
+++ b/swagger/definitions/request/user/create_update_payload.yml
@@ -3,13 +3,20 @@ properties:
name:
type: string
description: Name of the user
+ example: 'Daniel'
+ display_name:
+ type: string
+ description: Display name of the user
+ example: 'Dan'
email:
type: string
description: Email of the user
+ example: 'daniel@acme.inc'
password:
type: string
description: Password must contain uppercase, lowercase letters, number and a special character
+ example: 'Password2!'
custom_attributes:
type: object
description: Custom attributes you want to associate with the user
-
+ example: {}
diff --git a/swagger/definitions/request/webhooks/create_update_payload.yml b/swagger/definitions/request/webhooks/create_update_payload.yml
index 417843fe6..2f4a718e4 100644
--- a/swagger/definitions/request/webhooks/create_update_payload.yml
+++ b/swagger/definitions/request/webhooks/create_update_payload.yml
@@ -3,16 +3,23 @@ properties:
url:
type: string
description: The url where the events should be sent
+ example: https://example.com/webhook
subscriptions:
type: array
items:
type: string
- enum: [
- "conversation_created",
- "conversation_status_changed",
- "conversation_updated",
- "message_created",
- "message_updated",
- "webwidget_triggered"
- ]
+ enum:
+ [
+ 'conversation_created',
+ 'conversation_status_changed',
+ 'conversation_updated',
+ 'message_created',
+ 'message_updated',
+ 'contact_created',
+ 'contact_updated',
+ 'webwidget_triggered',
+ ]
description: The events you want to subscribe to.
+ example:
+ - conversation_created
+ - conversation_status_changed
diff --git a/swagger/definitions/resource/account_user.yml b/swagger/definitions/resource/account_user.yml
new file mode 100644
index 000000000..cfc530383
--- /dev/null
+++ b/swagger/definitions/resource/account_user.yml
@@ -0,0 +1,14 @@
+type: array
+description: 'Array of account users'
+items:
+ type: object
+ properties:
+ account_id:
+ type: integer
+ description: The ID of the account
+ user_id:
+ type: integer
+ description: The ID of the user
+ role:
+ type: string
+ description: whether user is an administrator or agent
diff --git a/swagger/definitions/resource/agent.yml b/swagger/definitions/resource/agent.yml
index e3d506a3b..5287f3e6f 100644
--- a/swagger/definitions/resource/agent.yml
+++ b/swagger/definitions/resource/agent.yml
@@ -2,31 +2,34 @@ type: object
properties:
id:
type: integer
- uid:
- type: string
- name:
- type: string
- available_name:
- type: string
- display_name:
- type: string
- email:
- type: string
account_id:
type: integer
- role:
- type: string
- enum: ['agent', 'administrator']
- confirmed:
- type: boolean
- availability_status:
+ availability_status:
type: string
enum: ['available', 'busy', 'offline']
description: The availability status of the agent computed by Chatwoot.
auto_offline:
type: boolean
description: Whether the availability status of agent is configured to go offline automatically when away.
- custom_attributes:
- type: object
- description: Available for users who are created through platform APIs and has custom attributes associated.
-
+ confirmed:
+ type: boolean
+ description: Whether the agent has confirmed their email address.
+ email:
+ type: string
+ description: The email of the agent
+ available_name:
+ type: string
+ description: The available name of the agent
+ name:
+ type: string
+ description: The name of the agent
+ role:
+ type: string
+ enum: ['agent', 'administrator']
+ description: The role of the agent
+ thumbnail:
+ type: string
+ description: The thumbnail of the agent
+ custom_role_id:
+ type: integer
+ description: The custom role id of the agent
diff --git a/swagger/definitions/resource/agent_bot.yml b/swagger/definitions/resource/agent_bot.yml
index d94777d37..963b4f0b9 100644
--- a/swagger/definitions/resource/agent_bot.yml
+++ b/swagger/definitions/resource/agent_bot.yml
@@ -9,9 +9,24 @@ properties:
description:
type: string
description: The description about the agent bot
- account_id:
- type: number
- description: Account ID if it's an account specific bot
+ thumbnail:
+ type: string
+ description: The thumbnail of the agent bot
outgoing_url:
type: string
description: The webhook URL for the bot
+ bot_type:
+ type: string
+ description: The type of the bot
+ bot_config:
+ type: object
+ description: The configuration of the bot
+ account_id:
+ type: number
+ description: Account ID if it's an account specific bot
+ access_token:
+ type: string
+ description: The access token for the bot
+ system_bot:
+ type: boolean
+ description: Whether the bot is a system bot
diff --git a/swagger/definitions/resource/automation_rule.yml b/swagger/definitions/resource/automation_rule.yml
index 4a3a03d01..b561441ff 100644
--- a/swagger/definitions/resource/automation_rule.yml
+++ b/swagger/definitions/resource/automation_rule.yml
@@ -1,45 +1,13 @@
type: object
properties:
- event_name:
- type: string
- description: Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)
- enum:
- - conversation_created
- - conversation_updated
- - message_created
- example: message_created
- name:
- type: string
- description: The name of the rule
- example: Add label on message create event
- description:
- type: string
- description: Description to give more context about the rule
- example: Add label support and sales on message create event if incoming message content contains text help
- active:
- type: boolean
- description: Enable/disable automation rule
- actions:
- type: array
- description: Array of actions which we perform when condition matches
- items:
- type: object
- example:
- action_name: add_label
- action_params:
- - support
- - sales
- conditions:
- type: array
- description: Array of conditions on which conversation/message filter would work
- items:
- type: object
- example:
- attribute_key: content
- filter_operator: contains
- values:
- - help
- query_operator: nil
- account_id:
- type: integer
- description: Account Id
+ payload:
+ description: Response payload that contains automation rule(s)
+ oneOf:
+ - type: array
+ description: Array of automation rules (for listing endpoint)
+ items:
+ $ref: '#/components/schemas/automation_rule_item'
+ - type: object
+ description: Single automation rule (for show/create/update endpoints)
+ allOf:
+ - $ref: '#/components/schemas/automation_rule_item'
\ No newline at end of file
diff --git a/swagger/definitions/resource/automation_rule_item.yml b/swagger/definitions/resource/automation_rule_item.yml
new file mode 100644
index 000000000..b3b644b2e
--- /dev/null
+++ b/swagger/definitions/resource/automation_rule_item.yml
@@ -0,0 +1,69 @@
+type: object
+properties:
+ id:
+ type: integer
+ description: The ID of the automation rule
+ account_id:
+ type: integer
+ description: Account Id
+ name:
+ type: string
+ description: The name of the rule
+ example: Add label on message create event
+ description:
+ type: string
+ description: Description to give more context about the rule
+ example: Add label support and sales on message create event if incoming message content contains text help
+ event_name:
+ type: string
+ description: Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)
+ enum:
+ - conversation_created
+ - conversation_updated
+ - message_created
+ example: message_created
+ conditions:
+ type: array
+ description: Array of conditions on which conversation/message filter would work
+ items:
+ type: object
+ properties:
+ values:
+ type: array
+ items:
+ type: string
+ attribute_key:
+ type: string
+ query_operator:
+ type: string
+ filter_operator:
+ type: string
+ example:
+ attribute_key: content
+ filter_operator: contains
+ values:
+ - help
+ query_operator: and
+ actions:
+ type: array
+ description: Array of actions which we perform when condition matches
+ items:
+ type: object
+ properties:
+ action_name:
+ type: string
+ action_params:
+ type: array
+ items:
+ type: string
+ example:
+ action_name: add_label
+ action_params:
+ - support
+ - sales
+ created_on:
+ type: integer
+ description: The timestamp when the rule was created
+ active:
+ type: boolean
+ description: Enable/disable automation rule
\ No newline at end of file
diff --git a/swagger/definitions/resource/canned_response.yml b/swagger/definitions/resource/canned_response.yml
index b044b703a..8e4f73370 100644
--- a/swagger/definitions/resource/canned_response.yml
+++ b/swagger/definitions/resource/canned_response.yml
@@ -3,12 +3,18 @@ properties:
id:
type: integer
description: ID of the canned response
- content:
- type: string
- description: Message content for canned response
- short_code:
- type: string
- description: Short Code for quick access of the canned response
account_id:
type: integer
description: Account Id
+ short_code:
+ type: string
+ description: Short Code for quick access of the canned response
+ content:
+ type: string
+ description: Message content for canned response
+ created_at:
+ type: string
+ description: The date and time when the canned response was created
+ updated_at:
+ type: string
+ description: The date and time when the canned response was updated
diff --git a/swagger/definitions/resource/contact.yml b/swagger/definitions/resource/contact.yml
index bbb82e14c..259604f0d 100644
--- a/swagger/definitions/resource/contact.yml
+++ b/swagger/definitions/resource/contact.yml
@@ -1,31 +1,49 @@
type: object
properties:
payload:
- type: object
- properties:
- contact:
- type: object
- properties:
- email:
- type: string
- description: Email address of the contact
- name:
- type: string
- description: The name of the contact
- phone_number:
- type: string
- description: Phone number of the contact
- thumbnail:
- type: string
- description: Avatar URL of the contact
- additional_attributes:
- type: object
- description: The object containing additional attributes related to the contact
- custom_attributes:
- type: object
- description: The object to save custom attributes for contact, accepts custom attributes key and value
- example: { attribute_key: attribute_value, signed_up_at: dd/mm/yyyy }
- contact_inboxes:
- type: array
- items:
- $ref: '#/definitions/contact_inboxes'
+ type: array
+ items:
+ type: object
+ properties:
+ additional_attributes:
+ type: object
+ description: The object containing additional attributes related to the contact
+ availability_status:
+ type: string
+ description: The availability status of the contact
+ email:
+ type: string
+ description: The email address of the contact
+ id:
+ type: integer
+ description: The ID of the contact
+ name:
+ type: string
+ description: The name of the contact
+ phone_number:
+ type: string
+ description: The phone number of the contact
+ blocked:
+ type: boolean
+ description: Whether the contact is blocked
+ identifier:
+ type: string
+ description: The identifier of the contact
+ thumbnail:
+ type: string
+ description: The thumbnail of the contact
+ custom_attributes:
+ type: object
+ description: The custom attributes of the contact
+ example:
+ { attribute_key: attribute_value, signed_up_at: dd/mm/yyyy }
+ last_activity_at:
+ type: integer
+ description: The last activity at of the contact
+ created_at:
+ type: integer
+ description: The created at of the contact
+ contact_inboxes:
+ type: array
+ items:
+ $ref: '#/components/schemas/contact_inboxes'
diff --git a/swagger/definitions/resource/contact_conversation_message.yml b/swagger/definitions/resource/contact_conversation_message.yml
new file mode 100644
index 000000000..e95923e52
--- /dev/null
+++ b/swagger/definitions/resource/contact_conversation_message.yml
@@ -0,0 +1,109 @@
+type: object
+properties:
+ id:
+ type: integer
+ description: ID of the message
+ content:
+ type: string
+ description: Content of the message
+ account_id:
+ type: integer
+ description: ID of the account
+ inbox_id:
+ type: integer
+ description: ID of the inbox
+ conversation_id:
+ type: integer
+ description: ID of the conversation
+ message_type:
+ type: integer
+ description: Type of the message
+ created_at:
+ type: integer
+ description: Timestamp when message was created
+ updated_at:
+ type: string
+ description: Formatted datetime when message was updated
+ private:
+ type: boolean
+ description: Whether the message is private
+ status:
+ type: string
+ description: Status of the message
+ source_id:
+ type: string
+ description: Source ID of the message
+ nullable: true
+ content_type:
+ type: string
+ description: Type of the content
+ content_attributes:
+ type: object
+ description: Attributes of the content
+ sender_type:
+ type: string
+ description: Type of the sender
+ nullable: true
+ sender_id:
+ type: integer
+ description: ID of the sender
+ nullable: true
+ external_source_ids:
+ type: object
+ description: External source IDs
+ additional_attributes:
+ type: object
+ description: Additional attributes of the message
+ processed_message_content:
+ type: string
+ description: Processed message content
+ nullable: true
+ sentiment:
+ type: object
+ description: Sentiment analysis of the message
+ conversation:
+ type: object
+ description: Conversation details
+ properties:
+ assignee_id:
+ type: integer
+ description: ID of the assignee
+ nullable: true
+ unread_count:
+ type: integer
+ description: Count of unread messages
+ last_activity_at:
+ type: integer
+ description: Timestamp of last activity
+ contact_inbox:
+ type: object
+ description: Contact inbox details
+ properties:
+ source_id:
+ type: string
+ description: Source ID of the contact inbox
+ sender:
+ type: object
+ description: Details of the sender
+ properties:
+ id:
+ type: integer
+ description: ID of the sender
+ name:
+ type: string
+ description: Name of the sender
+ available_name:
+ type: string
+ description: Available name of the sender
+ avatar_url:
+ type: string
+ description: URL of the sender's avatar
+ type:
+ type: string
+ description: Type of the sender
+ availability_status:
+ type: string
+ description: Availability status of the sender
+ thumbnail:
+ type: string
+ description: Thumbnail URL of the sender
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_conversations_response.yml b/swagger/definitions/resource/contact_conversations_response.yml
new file mode 100644
index 000000000..9e77858a8
--- /dev/null
+++ b/swagger/definitions/resource/contact_conversations_response.yml
@@ -0,0 +1,13 @@
+type: object
+properties:
+ payload:
+ type: array
+ items:
+ allOf:
+ - $ref: '#/components/schemas/conversation'
+ - type: object
+ properties:
+ meta:
+ $ref: './extension/contact/conversation.yml#/properties/meta'
+ description: Meta information about the conversation
+ description: List of conversations for the contact
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_detail.yml b/swagger/definitions/resource/contact_detail.yml
new file mode 100644
index 000000000..060c91214
--- /dev/null
+++ b/swagger/definitions/resource/contact_detail.yml
@@ -0,0 +1,48 @@
+type: object
+properties:
+ additional_attributes:
+ type: object
+ description: The object containing additional attributes related to the contact
+ properties:
+ city:
+ type: string
+ description: City of the contact
+ country:
+ type: string
+ description: Country of the contact
+ country_code:
+ type: string
+ description: Country code of the contact
+ created_at_ip:
+ type: string
+ description: IP address when the contact was created
+ custom_attributes:
+ type: object
+ description: The custom attributes of the contact
+ email:
+ type: string
+ description: The email address of the contact
+ id:
+ type: integer
+ description: The ID of the contact
+ identifier:
+ type: string
+ description: The identifier of the contact
+ nullable: true
+ name:
+ type: string
+ description: The name of the contact
+ phone_number:
+ type: string
+ description: The phone number of the contact
+ nullable: true
+ thumbnail:
+ type: string
+ description: The thumbnail of the contact
+ blocked:
+ type: boolean
+ description: Whether the contact is blocked
+ type:
+ type: string
+ description: The type of entity
+ enum: ["contact"]
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_inbox.yml b/swagger/definitions/resource/contact_inbox.yml
new file mode 100644
index 000000000..34fd374f2
--- /dev/null
+++ b/swagger/definitions/resource/contact_inbox.yml
@@ -0,0 +1,27 @@
+type: object
+properties:
+ source_id:
+ type: string
+ description: Source identifier for the contact inbox
+ inbox:
+ type: object
+ properties:
+ id:
+ type: integer
+ description: ID of the inbox
+ avatar_url:
+ type: string
+ description: URL for the inbox avatar
+ channel_id:
+ type: integer
+ description: ID of the channel
+ name:
+ type: string
+ description: Name of the inbox
+ channel_type:
+ type: string
+ description: Type of channel
+ provider:
+ type: string
+ description: Provider of the inbox
+ nullable: true
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_inboxes.yml b/swagger/definitions/resource/contact_inboxes.yml
index a223490ff..5eabeff13 100644
--- a/swagger/definitions/resource/contact_inboxes.yml
+++ b/swagger/definitions/resource/contact_inboxes.yml
@@ -4,5 +4,4 @@ properties:
type: string
description: Contact Inbox Source Id
inbox:
- type: object
- $ref: '#/definitions/inbox'
+ $ref: '#/components/schemas/inbox_contact'
diff --git a/swagger/definitions/resource/contact_list_item.yml b/swagger/definitions/resource/contact_list_item.yml
new file mode 100644
index 000000000..7765b2265
--- /dev/null
+++ b/swagger/definitions/resource/contact_list_item.yml
@@ -0,0 +1,61 @@
+type: object
+properties:
+ additional_attributes:
+ type: object
+ description: The object containing additional attributes related to the contact
+ properties:
+ city:
+ type: string
+ description: City of the contact
+ country:
+ type: string
+ description: Country of the contact
+ country_code:
+ type: string
+ description: Country code of the contact
+ created_at_ip:
+ type: string
+ description: IP address when the contact was created
+ availability_status:
+ type: string
+ description: Availability status of the contact
+ enum: ["online", "offline"]
+ email:
+ type: string
+ description: The email address of the contact
+ nullable: true
+ id:
+ type: integer
+ description: The ID of the contact
+ name:
+ type: string
+ description: The name of the contact
+ phone_number:
+ type: string
+ description: The phone number of the contact
+ nullable: true
+ blocked:
+ type: boolean
+ description: Whether the contact is blocked
+ identifier:
+ type: string
+ description: The identifier of the contact
+ nullable: true
+ thumbnail:
+ type: string
+ description: The thumbnail of the contact
+ custom_attributes:
+ type: object
+ description: The custom attributes of the contact
+ last_activity_at:
+ type: integer
+ description: Timestamp of last activity
+ nullable: true
+ created_at:
+ type: integer
+ description: Timestamp when contact was created
+ contact_inboxes:
+ type: array
+ description: List of inboxes associated with this contact
+ items:
+ $ref: '#/components/schemas/contact_inbox'
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_meta.yml b/swagger/definitions/resource/contact_meta.yml
new file mode 100644
index 000000000..f7139b9d2
--- /dev/null
+++ b/swagger/definitions/resource/contact_meta.yml
@@ -0,0 +1,8 @@
+type: object
+properties:
+ count:
+ type: integer
+ description: Total number of contacts
+ current_page:
+ type: string
+ description: Current page number
\ No newline at end of file
diff --git a/swagger/definitions/resource/contact_show_response.yml b/swagger/definitions/resource/contact_show_response.yml
new file mode 100644
index 000000000..e4f861271
--- /dev/null
+++ b/swagger/definitions/resource/contact_show_response.yml
@@ -0,0 +1,5 @@
+type: object
+properties:
+ payload:
+ $ref: '#/components/schemas/contact_list_item'
+ description: Contact details
\ No newline at end of file
diff --git a/swagger/definitions/resource/contactable_inboxes.yml b/swagger/definitions/resource/contactable_inboxes.yml
index a223490ff..7ccba61b1 100644
--- a/swagger/definitions/resource/contactable_inboxes.yml
+++ b/swagger/definitions/resource/contactable_inboxes.yml
@@ -5,4 +5,4 @@ properties:
description: Contact Inbox Source Id
inbox:
type: object
- $ref: '#/definitions/inbox'
+ $ref: '#/components/schemas/inbox'
diff --git a/swagger/definitions/resource/contactable_inboxes_response.yml b/swagger/definitions/resource/contactable_inboxes_response.yml
new file mode 100644
index 000000000..5af3e7dc8
--- /dev/null
+++ b/swagger/definitions/resource/contactable_inboxes_response.yml
@@ -0,0 +1,7 @@
+type: object
+properties:
+ payload:
+ type: array
+ items:
+ $ref: '#/components/schemas/contact_inbox'
+ description: List of contactable inboxes for the contact
\ No newline at end of file
diff --git a/swagger/definitions/resource/contacts_list_response.yml b/swagger/definitions/resource/contacts_list_response.yml
new file mode 100644
index 000000000..75a63b5c3
--- /dev/null
+++ b/swagger/definitions/resource/contacts_list_response.yml
@@ -0,0 +1,10 @@
+type: object
+properties:
+ meta:
+ $ref: '#/components/schemas/contact_meta'
+ description: Metadata about the contact list response
+ payload:
+ type: array
+ items:
+ $ref: '#/components/schemas/contact_list_item'
+ description: List of contacts
\ No newline at end of file
diff --git a/swagger/definitions/resource/conversation.yml b/swagger/definitions/resource/conversation.yml
index 085d21879..c1577e693 100644
--- a/swagger/definitions/resource/conversation.yml
+++ b/swagger/definitions/resource/conversation.yml
@@ -6,31 +6,86 @@ properties:
messages:
type: array
items:
- $ref: '#/definitions/message'
+ $ref: '#/components/schemas/message'
account_id:
type: number
description: Account Id
+ uuid:
+ type: string
+ description: UUID of the conversation
+ additional_attributes:
+ type: object
+ description: The object containing additional attributes related to the conversation
+ agent_last_seen_at:
+ type: number
+ description: The last activity at of the agent
+ assignee_last_seen_at:
+ type: number
+ description: The last activity at of the assignee
+ can_reply:
+ type: boolean
+ description: Whether the conversation can be replied to
+ contact_last_seen_at:
+ type: number
+ description: The last activity at of the contact
+ custom_attributes:
+ type: object
+ description: The object to save custom attributes for conversation, accepts custom attributes key and value
inbox_id:
type: number
description: ID of the inbox
+ labels:
+ type: array
+ items:
+ type: string
+ description: The labels of the conversation
+ muted:
+ type: boolean
+ description: Whether the conversation is muted
+ snoozed_until:
+ type: number
+ description: The time at which the conversation will be unmuted
status:
type: string
enum: ['open', 'resolved', 'pending']
description: The status of the conversation
+ created_at:
+ type: number
+ description: The time at which conversation was created
+ updated_at:
+ type: number
+ description: The time at which conversation was updated
timestamp:
type: string
description: The time at which conversation was created
- contact_last_seen_at:
- type: string
- agent_last_seen_at:
- type: string
+ first_reply_created_at:
+ type: number
+ description: The time at which the first reply was created
unread_count:
type: number
description: The number of unread messages
- additional_attributes:
+ last_non_activity_message:
type: object
- description: The object containing additional attributes related to the conversation
- custom_attributes:
+ $ref: '#/components/schemas/message'
+ description: The last non activity message
+ last_activity_at:
+ type: number
+ description: The last activity at of the conversation
+ priority:
+ type: string
+ description: The priority of the conversation
+ waiting_since:
+ type: number
+ description: The time at which the conversation was waiting
+ sla_policy_id:
+ type: number
+ description: The ID of the SLA policy
+ applied_sla:
type: object
- description: The object to save custom attributes for conversation, accepts custom attributes key and value
- example: { attribute_key: attribute_value, priority_conversation_number: 3 }
+ description: The applied SLA
+ sla_events:
+ type: array
+ items:
+ type: object
+ description: SLA event objects
+
diff --git a/swagger/definitions/resource/conversation_messages.yml b/swagger/definitions/resource/conversation_messages.yml
new file mode 100644
index 000000000..904f2f2d4
--- /dev/null
+++ b/swagger/definitions/resource/conversation_messages.yml
@@ -0,0 +1,10 @@
+type: object
+properties:
+ meta:
+ $ref: '#/components/schemas/conversation_meta'
+ description: Meta information about the conversation
+ payload:
+ type: array
+ items:
+ $ref: '#/components/schemas/message_detailed'
+ description: List of messages in the conversation
\ No newline at end of file
diff --git a/swagger/definitions/resource/conversation_meta.yml b/swagger/definitions/resource/conversation_meta.yml
new file mode 100644
index 000000000..7cffc0fab
--- /dev/null
+++ b/swagger/definitions/resource/conversation_meta.yml
@@ -0,0 +1,55 @@
+type: object
+properties:
+ labels:
+ type: array
+ items:
+ type: string
+ description: Labels associated with the conversation
+ additional_attributes:
+ type: object
+ properties:
+ browser:
+ type: object
+ properties:
+ device_name:
+ type: string
+ description: Name of the device
+ browser_name:
+ type: string
+ description: Name of the browser
+ platform_name:
+ type: string
+ description: Name of the platform
+ browser_version:
+ type: string
+ description: Version of the browser
+ platform_version:
+ type: string
+ description: Version of the platform
+ referer:
+ type: string
+ description: Referrer URL
+ initiated_at:
+ type: object
+ properties:
+ timestamp:
+ type: string
+ description: Timestamp when the conversation was initiated
+ browser_language:
+ type: string
+ description: Browser language setting
+ conversation_language:
+ type: string
+ description: Conversation language
+ description: Additional attributes of the conversation
+ contact:
+ $ref: '#/components/schemas/contact_detail'
+ description: Contact details
+ agent_last_seen_at:
+ type: string
+ description: Timestamp when the agent last saw the conversation
+ nullable: true
+ assignee_last_seen_at:
+ type: string
+ description: Timestamp when the assignee last saw the conversation
+ nullable: true
\ No newline at end of file
diff --git a/swagger/definitions/resource/custom_attribute.yml b/swagger/definitions/resource/custom_attribute.yml
index ba36fd714..67247f003 100644
--- a/swagger/definitions/resource/custom_attribute.yml
+++ b/swagger/definitions/resource/custom_attribute.yml
@@ -15,15 +15,24 @@ properties:
attribute_key:
type: string
description: Attribute unique key value
+ regex_pattern:
+ type: string
+ description: Regex pattern
+ regex_cue:
+ type: string
+ description: Regex cue
attribute_values:
type: string
description: Attribute values
- default_value:
- type: string
- description: Attribute default value
attribute_model:
type: string
description: Attribute type(conversation_attribute/contact_attribute)
- account_id:
- type: integer
- description: Account Id
+ default_value:
+ type: string
+ description: Attribute default value
+ created_at:
+ type: string
+ description: The date and time when the custom attribute was created
+ updated_at:
+ type: string
+ description: The date and time when the custom attribute was updated
diff --git a/swagger/definitions/resource/extension/contact/conversation.yml b/swagger/definitions/resource/extension/contact/conversation.yml
index 6e6576f80..ef1b0eb75 100644
--- a/swagger/definitions/resource/extension/contact/conversation.yml
+++ b/swagger/definitions/resource/extension/contact/conversation.yml
@@ -6,17 +6,48 @@ properties:
sender:
type: object
properties:
+ additional_attributes:
+ type: object
+ description: The additional attributes of the sender
+ availability_status:
+ type: string
+ description: The availability status of the sender
+ email:
+ type: string
+ description: The email of the sender
id:
type: number
description: ID fo the sender
name:
type: string
description: The name of the sender
+ phone_number:
+ type: string
+ description: The phone number of the sender
+ blocked:
+ type: boolean
+ description: Whether the sender is blocked
+ identifier:
+ type: string
+ description: The identifier of the sender
thumbnail:
type: string
description: Avatar URL of the contact
- channel:
- type: string
- description: Channel Type
+ custom_attributes:
+ type: object
+ description: The custom attributes of the sender
+ last_activity_at:
+ type: number
+ description: The last activity at of the sender
+ created_at:
+ type: number
+ description: The created at of the sender
+
+ channel:
+ type: string
+ description: Channel Type
assignee:
- $ref: '#/definitions/user'
+ $ref: '#/components/schemas/user'
+ hmac_verified:
+ type: boolean
+ description: Whether the hmac is verified
diff --git a/swagger/definitions/resource/extension/conversation/list.yml b/swagger/definitions/resource/extension/conversation/list.yml
index 426902d4f..39e04baa0 100644
--- a/swagger/definitions/resource/extension/conversation/list.yml
+++ b/swagger/definitions/resource/extension/conversation/list.yml
@@ -19,6 +19,6 @@ properties:
description: 'array of conversations'
items:
allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/conversation'
+ - $ref: '#/components/schemas/generic_id'
+ - $ref: '#/components/schemas/conversation'
- $ref: '../contact/conversation.yml'
diff --git a/swagger/definitions/resource/extension/conversation/show.yml b/swagger/definitions/resource/extension/conversation/show.yml
index fb697ad38..27a27018b 100644
--- a/swagger/definitions/resource/extension/conversation/show.yml
+++ b/swagger/definitions/resource/extension/conversation/show.yml
@@ -1,4 +1,4 @@
type: object
allOf:
- - $ref: '#/definitions/conversation'
+ - $ref: '#/components/schemas/conversation'
- $ref: '../contact/conversation.yml'
diff --git a/swagger/definitions/resource/inbox.yml b/swagger/definitions/resource/inbox.yml
index bba46ea34..88f5ea288 100644
--- a/swagger/definitions/resource/inbox.yml
+++ b/swagger/definitions/resource/inbox.yml
@@ -39,3 +39,87 @@ properties:
greeting_message:
type: string
description: A greeting message when the user starts the conversation
+ channel_id:
+ type: number
+ description: ID of the channel this inbox belongs to
+ working_hours_enabled:
+ type: boolean
+ description: The flag which shows whether working hours feature is enabled
+ enable_email_collect:
+ type: boolean
+ description: The flag to enable collecting email from contacts
+ csat_survey_enabled:
+ type: boolean
+ description: The flag to enable CSAT survey
+ auto_assignment_config:
+ type: object
+ description: Configuration settings for auto assignment
+ out_of_office_message:
+ type: string
+ description: Message to show when agents are out of office
+ working_hours:
+ type: array
+ description: Configuration for working hours of the inbox
+ items:
+ type: object
+ properties:
+ day_of_week:
+ type: number
+ description: Day of the week (0-6, where 0 is Sunday)
+ closed_all_day:
+ type: boolean
+ description: Whether the inbox is closed for the entire day
+ open_hour:
+ type: number
+ description: Hour when inbox opens (0-23)
+ open_minutes:
+ type: number
+ description: Minutes of the hour when inbox opens (0-59)
+ close_hour:
+ type: number
+ description: Hour when inbox closes (0-23)
+ close_minutes:
+ type: number
+ description: Minutes of the hour when inbox closes (0-59)
+ open_all_day:
+ type: boolean
+ description: Whether the inbox is open for the entire day
+ timezone:
+ type: string
+ description: Timezone configuration for the inbox
+ callback_webhook_url:
+ type: string
+ description: Webhook URL for callbacks
+ allow_messages_after_resolved:
+ type: boolean
+ description: Whether to allow messages after a conversation is resolved
+ lock_to_single_conversation:
+ type: boolean
+ description: Whether to lock a contact to a single conversation
+ sender_name_type:
+ type: string
+ description: Type of sender name to display (e.g., friendly)
+ business_name:
+ type: string
+ description: Business name associated with the inbox
+ hmac_mandatory:
+ type: boolean
+ description: Whether HMAC verification is mandatory
+ selected_feature_flags:
+ type: object
+ description: Selected feature flags for the inbox
+ reply_time:
+ type: string
+ description: Expected reply time
+ messaging_service_sid:
+ type: string
+ description: Messaging service SID for SMS providers
+ phone_number:
+ type: string
+ description: Phone number associated with the inbox
+ medium:
+ type: string
+ description: Medium of communication (e.g., sms, email)
+ provider:
+ type: string
+ description: Provider of the channel
diff --git a/swagger/definitions/resource/inbox_contact.yml b/swagger/definitions/resource/inbox_contact.yml
new file mode 100644
index 000000000..fcac3d821
--- /dev/null
+++ b/swagger/definitions/resource/inbox_contact.yml
@@ -0,0 +1,20 @@
+type: object
+properties:
+ id:
+ type: number
+ description: ID of the inbox
+ avatar_url:
+ type: string
+ description: The avatar image of the inbox
+ channel_id:
+ type: number
+ description: The ID of the channel
+ name:
+ type: string
+ description: The name of the inbox
+ channel_type:
+ type: string
+ description: The type of the inbox
+ provider:
+ type: string
+ description: The provider of the inbox
diff --git a/swagger/definitions/resource/message.yml b/swagger/definitions/resource/message.yml
index 78c8fd640..f31936295 100644
--- a/swagger/definitions/resource/message.yml
+++ b/swagger/definitions/resource/message.yml
@@ -1,8 +1,40 @@
type: object
properties:
+ id:
+ type: number
+ description: The ID of the message
content:
type: string
description: The text content of the message
+ account_id:
+ type: number
+ description: The ID of the account
+ inbox_id:
+ type: number
+ description: The ID of the inbox
+ conversation_id:
+ type: number
+ description: The ID of the conversation
+ message_type:
+ type: integer
+ enum: [0, 1, 2]
+ description: The type of the message
+ created_at:
+ type: integer
+ description: The time at which message was created
+ updated_at:
+ type: integer
+ description: The time at which message was updated
+ private:
+ type: boolean
+ description: The flags which shows whether the message is private or not
+ status:
+ type: string
+ enum: ["sent", "delivered", "read", "failed"]
+ description: The status of the message
+ source_id:
+ type: string
+ description: The source ID of the message
content_type:
type: string
enum: ["text", "input_select", "cards", "form"]
@@ -10,22 +42,31 @@ properties:
content_attributes:
type: object
description: The content attributes for each content_type
- message_type:
+ sender_type:
type: string
- enum: ["incoming", "outgoing", "activity", "template"]
- description: The type of the message
- created_at:
- type: integer
- description: The time at which message was created
- private:
- type: boolean
- description: The flags which shows whether the message is private or not
+ enum: ["contact", "agent", "agent_bot"]
+ description: The type of the sender
+ sender_id:
+ type: number
+ description: The ID of the sender
+ external_source_ids:
+ type: object
+ description: The external source IDs of the message
+ additional_attributes:
+ type: object
+ description: The additional attributes of the message
+ processed_message_content:
+ type: string
+ description: The processed message content
+ sentiment:
+ type: object
+ description: The sentiment of the message
+ conversation:
+ type: object
+ description: The conversation object
attachment:
type: object
description: The file object attached to the image
sender:
type: object
description: User/Agent/AgentBot object
- conversation_id:
- type: number
- description: ID of the conversation
diff --git a/swagger/definitions/resource/message_detailed.yml b/swagger/definitions/resource/message_detailed.yml
new file mode 100644
index 000000000..49ff7aa09
--- /dev/null
+++ b/swagger/definitions/resource/message_detailed.yml
@@ -0,0 +1,47 @@
+type: object
+properties:
+ id:
+ type: number
+ description: The ID of the message
+ content:
+ type: string
+ description: The text content of the message
+ inbox_id:
+ type: number
+ description: The ID of the inbox
+ conversation_id:
+ type: number
+ description: The ID of the conversation
+ message_type:
+ type: integer
+ enum: [0, 1, 2, 3]
+ description: "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ content_type:
+ type: string
+ enum: ["text", "input_select", "cards", "form", "input_csat"]
+ description: The type of the message content
+ status:
+ type: string
+ enum: ["sent", "delivered", "read", "failed"]
+ description: The status of the message
+ content_attributes:
+ type: object
+ description: The content attributes for each content_type
+ properties:
+ in_reply_to:
+ type: string
+ description: ID of the message this is replying to
+ nullable: true
+ created_at:
+ type: integer
+ description: The timestamp when message was created
+ private:
+ type: boolean
+ description: The flag which shows whether the message is private or not
+ source_id:
+ type: string
+ description: The source ID of the message
+ nullable: true
+ sender:
+ $ref: '#/components/schemas/contact_detail'
+ description: The sender of the message (only for incoming messages)
\ No newline at end of file
diff --git a/swagger/definitions/resource/portal.yml b/swagger/definitions/resource/portal.yml
index a1bef33bc..5268e48d5 100644
--- a/swagger/definitions/resource/portal.yml
+++ b/swagger/definitions/resource/portal.yml
@@ -1,34 +1,6 @@
type: object
properties:
- id:
- type: integer
- archived:
- type: boolean
- color:
- type: string
- config:
- type: object
- description: Save information about locales, allowed_locales and default portal/help-center locale
- custom_domain:
- type: string
- header_text:
- type: string
- description: The text content.
- homepage_link:
- type: string
- name:
- type: string
- slug:
- type: string
- page_title:
- type: string
- account_id:
- type: integer
- categories:
+ payload:
type: array
items:
- $ref: '#/definitions/category'
- articles:
- type: array
- items:
- $ref: '#/definitions/article'
+ $ref: '#/components/schemas/portal_item'
diff --git a/swagger/definitions/resource/portal_config.yml b/swagger/definitions/resource/portal_config.yml
new file mode 100644
index 000000000..176c2ffc8
--- /dev/null
+++ b/swagger/definitions/resource/portal_config.yml
@@ -0,0 +1,18 @@
+type: object
+description: Configuration settings for the portal
+properties:
+ allowed_locales:
+ type: array
+ description: List of allowed locales for the portal
+ items:
+ type: object
+ properties:
+ code:
+ type: string
+ description: The language code
+ articles_count:
+ type: integer
+ description: Number of articles in this locale
+ categories_count:
+ type: integer
+ description: Number of categories in this locale
\ No newline at end of file
diff --git a/swagger/definitions/resource/portal_item.yml b/swagger/definitions/resource/portal_item.yml
new file mode 100644
index 000000000..461a64f3a
--- /dev/null
+++ b/swagger/definitions/resource/portal_item.yml
@@ -0,0 +1,40 @@
+type: object
+properties:
+ id:
+ type: integer
+ description: The ID of the portal
+ archived:
+ type: boolean
+ description: Whether the portal is archived
+ color:
+ type: string
+ description: The color code for the portal
+ config:
+ $ref: '#/components/schemas/portal_config'
+ custom_domain:
+ type: string
+ description: Custom domain for the portal
+ header_text:
+ type: string
+ description: The header text for the portal
+ homepage_link:
+ type: string
+ description: Homepage link for the portal
+ name:
+ type: string
+ description: Name of the portal
+ slug:
+ type: string
+ description: URL slug for the portal
+ page_title:
+ type: string
+ description: Page title for the portal
+ account_id:
+ type: integer
+ description: ID of the account the portal belongs to
+ inbox:
+ $ref: '#/components/schemas/inbox'
+ logo:
+ $ref: '#/components/schemas/portal_logo'
+ meta:
+ $ref: '#/components/schemas/portal_meta'
\ No newline at end of file
diff --git a/swagger/definitions/resource/portal_logo.yml b/swagger/definitions/resource/portal_logo.yml
new file mode 100644
index 000000000..606d655c7
--- /dev/null
+++ b/swagger/definitions/resource/portal_logo.yml
@@ -0,0 +1,23 @@
+type: object
+properties:
+ id:
+ type: integer
+ description: ID of the logo file
+ portal_id:
+ type: integer
+ description: ID of the portal this logo belongs to
+ file_type:
+ type: string
+ description: MIME type of the file
+ account_id:
+ type: integer
+ description: ID of the account
+ file_url:
+ type: string
+ description: URL to access the logo file
+ blob_id:
+ type: integer
+ description: ID of the blob
+ filename:
+ type: string
+ description: Name of the file
\ No newline at end of file
diff --git a/swagger/definitions/resource/portal_meta.yml b/swagger/definitions/resource/portal_meta.yml
new file mode 100644
index 000000000..64b44fc99
--- /dev/null
+++ b/swagger/definitions/resource/portal_meta.yml
@@ -0,0 +1,23 @@
+type: object
+properties:
+ all_articles_count:
+ type: integer
+ description: Total number of articles
+ archived_articles_count:
+ type: integer
+ nullable: true
+ description: Number of archived articles
+ published_count:
+ type: integer
+ nullable: true
+ description: Number of published articles
+ draft_articles_count:
+ type: integer
+ nullable: true
+ description: Number of draft articles
+ categories_count:
+ type: integer
+ description: Number of categories
+ default_locale:
+ type: string
+ description: Default locale for the portal
\ No newline at end of file
diff --git a/swagger/definitions/resource/portal_single.yml b/swagger/definitions/resource/portal_single.yml
new file mode 100644
index 000000000..2ca8c6e15
--- /dev/null
+++ b/swagger/definitions/resource/portal_single.yml
@@ -0,0 +1,5 @@
+type: object
+properties:
+ payload:
+ description: A single portal object (for show/update endpoints)
+ $ref: '#/components/schemas/portal_item'
\ No newline at end of file
diff --git a/swagger/definitions/resource/public/contact.yml b/swagger/definitions/resource/public/contact.yml
index ae2eae8d3..453ac5c97 100644
--- a/swagger/definitions/resource/public/contact.yml
+++ b/swagger/definitions/resource/public/contact.yml
@@ -1,5 +1,5 @@
type: object
-properties:
+properties:
id:
type: integer
description: Id of the contact
@@ -14,4 +14,4 @@ properties:
description: Email of the contact
pubsub_token:
type: string
- description: The token to be used to connect to chatwoot websocket
\ No newline at end of file
+ description: The token to be used to connect to chatwoot websocket
diff --git a/swagger/definitions/resource/public/conversation.yml b/swagger/definitions/resource/public/conversation.yml
index a2f797e1b..67febca2d 100644
--- a/swagger/definitions/resource/public/conversation.yml
+++ b/swagger/definitions/resource/public/conversation.yml
@@ -9,7 +9,7 @@ properties:
messages:
type: array
items:
- $ref: '#/definitions/message'
+ $ref: '#/components/schemas/message'
description: Messages in the conversation
contact:
type: object
diff --git a/swagger/definitions/resource/user.yml b/swagger/definitions/resource/user.yml
index c06cbab8e..329dba12e 100644
--- a/swagger/definitions/resource/user.yml
+++ b/swagger/definitions/resource/user.yml
@@ -2,27 +2,77 @@ type: object
properties:
id:
type: number
- uid:
- type: string
- name:
- type: string
- available_name:
- type: string
- display_name:
- type: string
- email:
+ access_token:
type: string
account_id:
type: number
+ available_name:
+ type: string
+ avatar_url:
+ type: string
+ confirmed:
+ type: boolean
+ display_name:
+ type: string
+ nullable: true
+ message_signature:
+ type: string
+ nullable: true
+ email:
+ type: string
+ hmac_identifier:
+ type: string
+ inviter_id:
+ type: number
+ name:
+ type: string
+ provider:
+ type: string
+ pubsub_token:
+ type: string
role:
type: string
enum: ['agent', 'administrator']
- confirmed:
- type: boolean
- custom_attributes:
+ ui_settings:
+ type: object
+ uid:
+ type: string
+ type:
+ type: string
+ nullable: true
+ custom_attributes:
type: object
description: Available for users who are created through platform APIs and has custom attributes associated.
accounts:
type: array
items:
- $ref: '#/definitions/account'
+ type: object
+ properties:
+ id:
+ type: number
+ name:
+ type: string
+ status:
+ type: string
+ active_at:
+ type: string
+ format: date-time
+ role:
+ type: string
+ enum: ['administrator', 'agent']
+ permissions:
+ type: array
+ items:
+ type: string
+ availability:
+ type: string
+ availability_status:
+ type: string
+ auto_offline:
+ type: boolean
+ custom_role_id:
+ type: number
+ nullable: true
+ custom_role:
+ type: object
+ nullable: true
diff --git a/swagger/index.yml b/swagger/index.yml
index 41f78dbc4..e27425d41 100644
--- a/swagger/index.yml
+++ b/swagger/index.yml
@@ -1,48 +1,94 @@
-swagger: "2.0"
+openapi: '3.0.4'
info:
- description: This is the API documentation for Chatwoot server.
- version: 1.0.0
title: Chatwoot
- termsOfService: https://www.chatwoot.com/terms-of-service/
+ description: This is the API documentation for Chatwoot server.
+ version: 1.1.0
+ termsOfService: https://www.chatwoot.com/terms-of-service/
contact:
email: hello@chatwoot.com
license:
name: MIT License
url: https://opensource.org/licenses/MIT
-host: app.chatwoot.com
-basePath: /
-schemes:
- - https
-produces:
-- application/json; charset=utf-8
-consumes:
-- application/json; charset=utf-8
-securityDefinitions:
- userApiKey:
- type: apiKey
- in: header
- name: api_access_token
- description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
- agentBotApiKey:
- type: apiKey
- in: header
- name: api_access_token
- description: This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis.
- platformAppApiKey:
- type: apiKey
- in: header
- name: api_access_token
- description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
-security:
- - userApiKey: []
-
+servers:
+ - url: https://app.chatwoot.com/
paths:
$ref: ./paths/index.yml
-definitions:
- $ref: ./definitions/index.yml
-parameters:
- $ref: ./parameters/index.yml
-
+components:
+ schemas:
+ $ref: ./definitions/index.yml
+ parameters:
+ $ref: ./parameters/index.yml
+ securitySchemes:
+ userApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user.
+ agentBotApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis.
+ platformAppApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
+tags:
+ - name: Accounts
+ description: Account management APIs
+ - name: Account Users
+ description: Account user management APIs
+ - name: AgentBots
+ description: Bot integrations
+ - name: Users
+ description: User management APIs
+ - name: Account AgentBots
+ description: Account-specific Agent Bots
+ - name: Agents
+ description: Agent management APIs
+ - name: Canned Responses
+ description: Pre-defined responses for common queries
+ - name: Contacts
+ description: Contact management APIs
+ - name: Contact Labels
+ description: Manage contact labels
+ - name: Conversation Assignments
+ description: Manage conversation assignments
+ - name: Conversation Labels
+ description: Manage conversation labels
+ - name: Conversations
+ description: Conversation management APIs
+ - name: Custom Attributes
+ description: Custom fields for contacts and conversations
+ - name: Custom Filters
+ description: Saved filters for conversations
+ - name: Inboxes
+ description: Communication channels setup
+ - name: Integrations
+ description: Third-party integrations
+ - name: Messages
+ description: Message management APIs
+ - name: Profile
+ description: User profile APIs
+ - name: Reports
+ description: Analytics and reporting APIs
+ - name: Teams
+ description: Team management APIs
+ - name: Webhooks
+ description: Event notification webhooks
+ - name: Automation Rule
+ description: Workflow automation rules
+ - name: Help Center
+ description: Knowledge base management
+ - name: Contacts API
+ description: Public contact APIs
+ - name: Conversations API
+ description: Public conversation APIs
+ - name: Messages API
+ description: Public message APIs
+ - name: CSAT Survey Page
+ description: Customer satisfaction survey
x-tagGroups:
- name: Platform
tags:
@@ -57,7 +103,7 @@ x-tagGroups:
- Canned Responses
- Contacts
- Contact Labels
- - Conversation Assignment
+ - Conversation Assignments
- Conversation Labels
- Conversations
- Custom Attributes
diff --git a/swagger/parameters/account_id.yml b/swagger/parameters/account_id.yml
index aa3d48a8a..133155c21 100644
--- a/swagger/parameters/account_id.yml
+++ b/swagger/parameters/account_id.yml
@@ -1,5 +1,6 @@
in: path
name: account_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the account
diff --git a/swagger/parameters/agent_bot_id.yml b/swagger/parameters/agent_bot_id.yml
index 6c94ef5dc..4d1479cb4 100644
--- a/swagger/parameters/agent_bot_id.yml
+++ b/swagger/parameters/agent_bot_id.yml
@@ -1,5 +1,6 @@
in: path
name: id
-type: integer
+schema:
+ type: integer
required: true
description: The ID of the agentbot to be updated
diff --git a/swagger/parameters/contact_sort.yml b/swagger/parameters/contact_sort.yml
index 6f3da0b1b..f25d07760 100644
--- a/swagger/parameters/contact_sort.yml
+++ b/swagger/parameters/contact_sort.yml
@@ -1,14 +1,15 @@
in: query
name: sort
-type: string
-enum:
- - name
- - email
- - phone_number
- - last_activity_at
- - -name
- - -email
- - -phone_number
- - -last_activity_at
+schema:
+ type: string
+ enum:
+ - name
+ - email
+ - phone_number
+ - last_activity_at
+ - -name
+ - -email
+ - -phone_number
+ - -last_activity_at
required: false
description: The attribute by which list should be sorted
diff --git a/swagger/parameters/conversation_id.yml b/swagger/parameters/conversation_id.yml
index d8de755fe..4f4cb19ab 100644
--- a/swagger/parameters/conversation_id.yml
+++ b/swagger/parameters/conversation_id.yml
@@ -1,5 +1,6 @@
in: path
name: conversation_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the conversation
diff --git a/swagger/parameters/conversation_uuid.yml b/swagger/parameters/conversation_uuid.yml
index b2bff7f39..c585ddc09 100644
--- a/swagger/parameters/conversation_uuid.yml
+++ b/swagger/parameters/conversation_uuid.yml
@@ -1,5 +1,6 @@
in: path
name: conversation_uuid
-type: integer
+schema:
+ type: integer
required: true
description: The uuid of the conversation
diff --git a/swagger/parameters/custom_filter_id.yml b/swagger/parameters/custom_filter_id.yml
index b19f52f8e..46776511f 100644
--- a/swagger/parameters/custom_filter_id.yml
+++ b/swagger/parameters/custom_filter_id.yml
@@ -1,5 +1,6 @@
in: path
name: custom_filter_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the custom filter
diff --git a/swagger/parameters/hook_id.yml b/swagger/parameters/hook_id.yml
index c1600def4..f1c50c3d4 100644
--- a/swagger/parameters/hook_id.yml
+++ b/swagger/parameters/hook_id.yml
@@ -1,5 +1,6 @@
in: path
name: hook_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the integration hook
diff --git a/swagger/parameters/inbox_id.yml b/swagger/parameters/inbox_id.yml
index 716d34de6..58640fb08 100644
--- a/swagger/parameters/inbox_id.yml
+++ b/swagger/parameters/inbox_id.yml
@@ -1,5 +1,6 @@
in: path
name: inbox_id
-type: integer
+schema:
+ type: integer
required: true
description: The ID of the Inbox
diff --git a/swagger/parameters/message_id.yml b/swagger/parameters/message_id.yml
index 3fc6edfcf..3064a31e2 100644
--- a/swagger/parameters/message_id.yml
+++ b/swagger/parameters/message_id.yml
@@ -1,5 +1,6 @@
in: path
name: message_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the message
diff --git a/swagger/parameters/page.yml b/swagger/parameters/page.yml
index 8cdc77b1e..3ef0f55b6 100644
--- a/swagger/parameters/page.yml
+++ b/swagger/parameters/page.yml
@@ -1,6 +1,7 @@
in: query
name: page
-type: integer
-default: 1
+schema:
+ type: integer
+ default: 1
required: false
description: The page parameter
diff --git a/swagger/parameters/platform_user_id.yml b/swagger/parameters/platform_user_id.yml
index d31f71878..708a0aad9 100644
--- a/swagger/parameters/platform_user_id.yml
+++ b/swagger/parameters/platform_user_id.yml
@@ -1,5 +1,6 @@
in: path
name: id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the user on the platform
diff --git a/swagger/parameters/portal_id.yml b/swagger/parameters/portal_id.yml
index b45f69629..dcd1f8b32 100644
--- a/swagger/parameters/portal_id.yml
+++ b/swagger/parameters/portal_id.yml
@@ -1,5 +1,6 @@
in: path
-name: portal_id
-type: integer
+name: id
+schema:
+ type: string
required: true
-description: The numeric ID of the portal
+description: The slug identifier of the portal
diff --git a/swagger/parameters/public/contact_identifier.yml b/swagger/parameters/public/contact_identifier.yml
index 6bb522c6b..3dd2d28c2 100644
--- a/swagger/parameters/public/contact_identifier.yml
+++ b/swagger/parameters/public/contact_identifier.yml
@@ -1,5 +1,6 @@
in: path
name: contact_identifier
-type: string
+schema:
+ type: string
required: true
description: The source id of contact obtained on contact create
diff --git a/swagger/parameters/public/inbox_identifier.yml b/swagger/parameters/public/inbox_identifier.yml
index 091c0d73e..35e33e6c2 100644
--- a/swagger/parameters/public/inbox_identifier.yml
+++ b/swagger/parameters/public/inbox_identifier.yml
@@ -1,5 +1,6 @@
in: path
name: inbox_identifier
-type: string
+schema:
+ type: string
required: true
description: The identifier obtained from API inbox channel
diff --git a/swagger/parameters/report_metric.yml b/swagger/parameters/report_metric.yml
index 552b0d310..c4bb6cc76 100644
--- a/swagger/parameters/report_metric.yml
+++ b/swagger/parameters/report_metric.yml
@@ -1,12 +1,13 @@
in: query
name: metric
-type: string
-enum:
- - conversations_count
- - incoming_messages_count
- - outgoing_messages_count
- - avg_first_response_time
- - avg_resolution_time
- - resolutions_count
+schema:
+ type: string
+ enum:
+ - conversations_count
+ - incoming_messages_count
+ - outgoing_messages_count
+ - avg_first_response_time
+ - avg_resolution_time
+ - resolutions_count
required: true
description: The type of metric
diff --git a/swagger/parameters/report_type.yml b/swagger/parameters/report_type.yml
index 9f5fbf363..668fd0922 100644
--- a/swagger/parameters/report_type.yml
+++ b/swagger/parameters/report_type.yml
@@ -1,11 +1,12 @@
in: query
name: type
-type: string
-enum:
- - account
- - agent
- - inbox
- - label
- - team
+schema:
+ type: string
+ enum:
+ - account
+ - agent
+ - inbox
+ - label
+ - team
required: true
description: Type of report
diff --git a/swagger/parameters/source_id.yml b/swagger/parameters/source_id.yml
index 408beed86..a2c3bb807 100644
--- a/swagger/parameters/source_id.yml
+++ b/swagger/parameters/source_id.yml
@@ -1,5 +1,6 @@
in: path
name: source_id
required: true
-type: string
+schema:
+ type: string
description: "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
diff --git a/swagger/parameters/team_id.yml b/swagger/parameters/team_id.yml
index c18532b75..9caca20b3 100644
--- a/swagger/parameters/team_id.yml
+++ b/swagger/parameters/team_id.yml
@@ -1,5 +1,6 @@
in: path
name: team_id
-type: integer
+schema:
+ type: integer
required: true
description: The ID of the team to be updated
diff --git a/swagger/parameters/webhook_id.yml b/swagger/parameters/webhook_id.yml
index 4400a082c..524a3e733 100644
--- a/swagger/parameters/webhook_id.yml
+++ b/swagger/parameters/webhook_id.yml
@@ -1,5 +1,6 @@
in: path
name: webhook_id
-type: integer
+schema:
+ type: integer
required: true
description: The numeric ID of the webhook
diff --git a/swagger/paths/application/agent_bots/create.yml b/swagger/paths/application/agent_bots/create.yml
index e0fde6184..bc97acb32 100644
--- a/swagger/paths/application/agent_bots/create.yml
+++ b/swagger/paths/application/agent_bots/create.yml
@@ -3,17 +3,24 @@ tags:
operationId: create-an-account-agent-bot
summary: Create an Agent Bot
description: Create an agent bot in the account
-parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/agent_bot_create_update_payload'
+security:
+ - userApiKey: []
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agent_bots/delete.yml b/swagger/paths/application/agent_bots/delete.yml
index 0e3daf6cb..84dcc6f55 100644
--- a/swagger/paths/application/agent_bots/delete.yml
+++ b/swagger/paths/application/agent_bots/delete.yml
@@ -3,10 +3,20 @@ tags:
operationId: delete-an-account-agent-bot
summary: Delete an AgentBot
description: Delete an AgentBot from the account
+security:
+ - userApiKey: []
responses:
200:
description: Success
401:
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
404:
description: The agent bot does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agent_bots/index.yml b/swagger/paths/application/agent_bots/index.yml
index 2c5fe289f..20b0bab82 100644
--- a/swagger/paths/application/agent_bots/index.yml
+++ b/swagger/paths/application/agent_bots/index.yml
@@ -3,14 +3,21 @@ tags:
operationId: list-all-account-agent-bots
summary: List all AgentBots
description: List all agent bots available for the current account
+security:
+ - userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of agent bots'
- items:
- $ref: '#/definitions/agent_bot'
-
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of agent bots'
+ items:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agent_bots/show.yml b/swagger/paths/application/agent_bots/show.yml
index b94637690..061908c2c 100644
--- a/swagger/paths/application/agent_bots/show.yml
+++ b/swagger/paths/application/agent_bots/show.yml
@@ -3,12 +3,24 @@ tags:
operationId: get-details-of-a-single-account-agent-bot
summary: Get an agent bot details
description: Get the details of an agent bot in the account
+security:
+ - userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given agent bot ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agent_bots/update.yml b/swagger/paths/application/agent_bots/update.yml
index 562d58841..0f988cb18 100644
--- a/swagger/paths/application/agent_bots/update.yml
+++ b/swagger/paths/application/agent_bots/update.yml
@@ -3,16 +3,24 @@ tags:
operationId: update-an-account-agent-bot
summary: Update an agent bot
description: Update an agent bot's attributes
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/agent_bot_create_update_payload'
+security:
+ - userApiKey: []
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agents/create.yml b/swagger/paths/application/agents/create.yml
index dd191d81f..51436381e 100644
--- a/swagger/paths/application/agents/create.yml
+++ b/swagger/paths/application/agents/create.yml
@@ -5,39 +5,23 @@ summary: Add a New Agent
description: Add a new Agent to Account
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - name
- - email
- - role
- properties:
- name:
- type: string
- description: Full Name of the agent
- email:
- type: string
- description: Email of the Agent
- role:
- type: string
- enum: ['agent', 'administrator']
- description: Whether its administrator or agent
- availability_status:
- type: string
- enum: ['available', 'busy', 'offline']
- description: The availability setting of the agent.
- auto_offline:
- type: boolean
- description: Whether the availability status of agent is configured to go offline automatically when away.
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- description: 'Newly Created Agent'
- $ref: '#/definitions/agent'
- 403:
+ content:
+ application/json:
+ schema:
+ description: 'Newly Created Agent'
+ $ref: '#/components/schemas/agent'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agents/delete.yml b/swagger/paths/application/agents/delete.yml
index 118ddf234..d006659e3 100644
--- a/swagger/paths/application/agents/delete.yml
+++ b/swagger/paths/application/agents/delete.yml
@@ -8,13 +8,22 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
- description: The ID of the agent to be deleted
+ description: The ID of the agent to be deleted.
responses:
200:
description: Success
404:
description: Agent not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
403:
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agents/index.yml b/swagger/paths/application/agents/index.yml
index 7961ad3b0..2073e2ba0 100644
--- a/swagger/paths/application/agents/index.yml
+++ b/swagger/paths/application/agents/index.yml
@@ -8,10 +8,16 @@ security:
responses:
200:
description: Success
- schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/definitions/agent'
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
403:
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/agents/update.yml b/swagger/paths/application/agents/update.yml
index a72f5ed4e..afb5579f3 100644
--- a/swagger/paths/application/agents/update.yml
+++ b/swagger/paths/application/agents/update.yml
@@ -8,35 +8,33 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the agent to be updated.
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - role
- properties:
- role:
- type: string
- enum: ['agent', 'administrator']
- description: Whether its administrator or agent
- availability:
- type: string
- enum: ['available', 'busy', 'offline']
- description: The availability setting of the agent.
- auto_offline:
- type: boolean
- description: Whether the availability status of agent is configured to go offline automatically when away.
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_update_payload'
responses:
200:
description: Success
- schema:
- description: 'The updated agent'
- $ref: '#/definitions/agent'
+ content:
+ application/json:
+ schema:
+ description: 'The updated agent'
+ $ref: '#/components/schemas/agent'
404:
description: Agent not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
403:
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/article/create.yml b/swagger/paths/application/article/create.yml
index 0733fb860..02b13b6c1 100644
--- a/swagger/paths/application/article/create.yml
+++ b/swagger/paths/application/article/create.yml
@@ -5,16 +5,22 @@ summary: Add a new article
description: Add a new article to portal
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/article_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/article_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/article'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/article'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/automation_rule/create.yml b/swagger/paths/application/automation_rule/create.yml
index ac5de803a..a8a309dad 100644
--- a/swagger/paths/application/automation_rule/create.yml
+++ b/swagger/paths/application/automation_rule/create.yml
@@ -5,16 +5,22 @@ summary: Add a new automation rule
description: Add a new automation rule to account
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/automation_rule_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/automation_rule'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/automation_rule/delete.yml b/swagger/paths/application/automation_rule/delete.yml
index f82647d1d..4d30fb812 100644
--- a/swagger/paths/application/automation_rule/delete.yml
+++ b/swagger/paths/application/automation_rule/delete.yml
@@ -8,7 +8,8 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the automation rule to be deleted
responses:
@@ -16,5 +17,13 @@ responses:
description: Success
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
'404':
description: automation rule not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/automation_rule/index.yml b/swagger/paths/application/automation_rule/index.yml
index 031696aeb..b5193e1af 100644
--- a/swagger/paths/application/automation_rule/index.yml
+++ b/swagger/paths/application/automation_rule/index.yml
@@ -3,18 +3,21 @@ tags:
operationId: get-account-automation-rule
summary: List all automation rules in an account
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/page'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/page'
description: Get details of automation rules in an Account
security:
- userApiKey: []
responses:
'200':
description: Success
- schema:
- type: array
- description: Array of all automation rules
- items:
- $ref: '#/definitions/automation_rule'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/automation_rule/show.yml b/swagger/paths/application/automation_rule/show.yml
index d99f8170b..ea3db048b 100644
--- a/swagger/paths/application/automation_rule/show.yml
+++ b/swagger/paths/application/automation_rule/show.yml
@@ -3,18 +3,51 @@ tags:
operationId: get-details-of-a-single-automation-rule
summary: Get a automation rule details
description: Get the details of a automation rule in the account
+security:
+ - userApiKey: []
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the automation rule to be updated.
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/automation_rule'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule'
+ example:
+ payload:
+ id: 90
+ account_id: 1
+ name: "add-label-bug-if-message-contains-bug"
+ description: "add-label-bug-if-message-contains-bug"
+ event_name: "message_created"
+ conditions:
+ - values: ["incoming"]
+ attribute_key: "message_type"
+ query_operator: "and"
+ filter_operator: "equal_to"
+ - values: ["bug"]
+ attribute_key: "content"
+ filter_operator: "contains"
+ actions:
+ - action_name: "add_label"
+ action_params: ["bugs", "support-query"]
+ created_on: 1650555440
+ active: true
'401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
'404':
description: The given rule ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/automation_rule/update.yml b/swagger/paths/application/automation_rule/update.yml
index 35a4cb67a..414885799 100644
--- a/swagger/paths/application/automation_rule/update.yml
+++ b/swagger/paths/application/automation_rule/update.yml
@@ -8,20 +8,32 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the automation rule to be updated.
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/automation_rule_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/automation_rule'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/automation_rule'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
'404':
description: Rule not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/canned_responses/create.yml b/swagger/paths/application/canned_responses/create.yml
index 95eacafb1..95d822a87 100644
--- a/swagger/paths/application/canned_responses/create.yml
+++ b/swagger/paths/application/canned_responses/create.yml
@@ -5,17 +5,23 @@ summary: Add a New Canned Response
description: Add a new Canned Response to Account
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/canned_response_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/canned_response_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- description: 'Newly Created Canned Response'
- $ref: '#/definitions/canned_response'
- 403:
+ content:
+ application/json:
+ schema:
+ description: 'Newly Created Canned Response'
+ $ref: '#/components/schemas/canned_response'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/canned_responses/delete.yml b/swagger/paths/application/canned_responses/delete.yml
index 2b1d08238..57ff1850b 100644
--- a/swagger/paths/application/canned_responses/delete.yml
+++ b/swagger/paths/application/canned_responses/delete.yml
@@ -8,13 +8,22 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the canned response to be deleted
responses:
- 200:
+ '200':
description: Success
- 404:
+ '404':
description: Canned Response not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/canned_responses/index.yml b/swagger/paths/application/canned_responses/index.yml
index 3094a23a6..1b8ad694c 100644
--- a/swagger/paths/application/canned_responses/index.yml
+++ b/swagger/paths/application/canned_responses/index.yml
@@ -6,12 +6,18 @@ description: Get Details of Canned Responses in an Account
security:
- userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all canned responses'
- items:
- $ref: '#/definitions/canned_response'
- 403:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all canned responses'
+ items:
+ $ref: '#/components/schemas/canned_response'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/canned_responses/update.yml b/swagger/paths/application/canned_responses/update.yml
index 7ea801f2f..57315d5be 100644
--- a/swagger/paths/application/canned_responses/update.yml
+++ b/swagger/paths/application/canned_responses/update.yml
@@ -1,5 +1,5 @@
tags:
- - Canned Response
+ - Canned Responses
operationId: update-canned-response-in-account
summary: Update Canned Response in Account
description: Update a Canned Response in Account
@@ -8,21 +8,33 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the canned response to be updated.
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/canned_response_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/canned_response_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- description: 'The updated canned response'
- $ref: '#/definitions/canned_response'
- 404:
+ content:
+ application/json:
+ schema:
+ description: 'The updated canned response'
+ $ref: '#/components/schemas/canned_response'
+ '404':
description: Agent not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/category/create.yml b/swagger/paths/application/category/create.yml
index 7b569a40b..56c757517 100644
--- a/swagger/paths/application/category/create.yml
+++ b/swagger/paths/application/category/create.yml
@@ -5,16 +5,22 @@ summary: Add a new category
description: Add a new category to portal
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/category_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/category_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/category'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/category'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contact_inboxes/create.yml b/swagger/paths/application/contact_inboxes/create.yml
index 2b784b5dd..64ebeb21c 100644
--- a/swagger/paths/application/contact_inboxes/create.yml
+++ b/swagger/paths/application/contact_inboxes/create.yml
@@ -5,34 +5,47 @@ post:
description: Create a contact inbox record for an inbox
summary: Create contact inbox
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the contact
required: true
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - inbox_id
- properties:
- inbox_id:
- type: number
- description: The ID of the inbox
- source_id:
- type: string
- description: Contact Inbox Source Id
+ security:
+ - userApiKey: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - inbox_id
+ properties:
+ inbox_id:
+ type: number
+ description: The ID of the inbox
+ example: 1
+ source_id:
+ type: string
+ description: Contact Inbox Source Id
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/contact_inboxes'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_inboxes'
+ '401':
description: Authentication error
- schema:
- $ref: '#/definitions/bad_request_error'
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: Incorrect payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contactable_inboxes/get.yml b/swagger/paths/application/contactable_inboxes/get.yml
index 23ce37788..357c84597 100644
--- a/swagger/paths/application/contactable_inboxes/get.yml
+++ b/swagger/paths/application/contactable_inboxes/get.yml
@@ -4,21 +4,32 @@ get:
operationId: contactableInboxesGet
description: Get List of contactable Inboxes
summary: Get Contactable Inboxes
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the contact
required: true
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/contactable_inboxes'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contactable_inboxes_response'
+ '401':
description: Authentication error
- schema:
- $ref: '#/definitions/bad_request_error'
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: Incorrect payload
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/conversations.yml b/swagger/paths/application/contacts/conversations.yml
index d08235f5e..b1bd7e522 100644
--- a/swagger/paths/application/contacts/conversations.yml
+++ b/swagger/paths/application/contacts/conversations.yml
@@ -1,22 +1,43 @@
+parameters:
+ - $ref: '#/components/parameters/account_id'
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: number
+ description: ID of the contact
+
get:
tags:
- Contacts
operationId: contactConversations
summary: Contact Conversations
- description: Get conversations associated to that contact
+ description: Get conversations associated with that contact
parameters:
- - $ref: '#/parameters/account_id'
- name: id
in: path
- type: number
- description: ID of the contact
required: true
- responses:
- 200:
- description: Success
schema:
- $ref: '#/definitions/contact_conversations'
- 404:
+ type: number
+ description: ID of the contact
+ security:
+ - userApiKey: []
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_conversations_response'
+ '404':
description: Contact not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/crud.yml b/swagger/paths/application/contacts/crud.yml
index 3c982dfe9..dcabb145d 100644
--- a/swagger/paths/application/contacts/crud.yml
+++ b/swagger/paths/application/contacts/crud.yml
@@ -1,58 +1,94 @@
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
- description: ID of the contact
required: true
+ schema:
+ type: number
+ description: ID of the contact
get:
tags:
- Contacts
operationId: contactDetails
summary: Show Contact
+ security:
+ - userApiKey: []
description: Get a contact belonging to the account using ID
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/extended_contact'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_show_response'
+ '404':
description: Contact not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
put:
tags:
- Contacts
operationId: contactUpdate
summary: Update Contact
+ security:
+ - userApiKey: []
description: Update a contact belonging to the account using ID
- parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/contact_update'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_update_payload'
responses:
- 204:
+ '204':
description: Success
- schema:
- $ref: '#/definitions/contact_base'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_base'
+ '404':
description: Contact not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
delete:
tags:
- Contacts
operationId: contactDelete
summary: Delete Contact
+ security:
+ - userApiKey: []
+ description: Delete a contact belonging to the account using ID
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Contact not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/filter.yml b/swagger/paths/application/contacts/filter.yml
index 2a1d53cf7..10d49f8c6 100644
--- a/swagger/paths/application/contacts/filter.yml
+++ b/swagger/paths/application/contacts/filter.yml
@@ -1,58 +1,64 @@
-tags:
- - Contacts
-operationId: contactFilter
-description: Filter contacts with custom filter options and pagination
-summary: Contact Filter
-security:
- - userApiKey: []
- - agentBotApiKey: []
-parameters:
- - name: page
- in: query
- type: integer
- - name: body
- in: body
+post:
+ tags:
+ - Contacts
+ operationId: contactFilter
+ description: Filter contacts with custom filter options and pagination
+ summary: Contact Filter
+ security:
+ - userApiKey: []
+ parameters:
+ - $ref: '#/components/parameters/account_id'
+ - name: page
+ in: query
+ schema:
+ type: number
+ requestBody:
required: true
- schema:
- type: object
- properties:
- payload:
- type: array
- items:
- type: object
- properties:
- attribute_key:
- type: string
- description: filter attribute name
- filter_operator:
- type: string
- description: filter operator name
- enum: [ equal_to, not_equal_to, contains, does_not_contain ]
- values:
- type: array
- items:
- type: string
- description: array of the attribute values to filter
- query_operator:
- type: string
- description: query operator name
- enum: [ AND, OR ]
- example:
- - attribute_key: 'name'
- filter_operator: 'equal_to'
- values: ['en']
- query_operator: 'AND'
- - attribute_key: 'country_code'
- filter_operator: 'equal_to'
- values: ['us']
- query_operator: null
-
-responses:
- 200:
- description: Success
- schema:
- $ref: '#/definitions/contact_list'
- 400:
- description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ items:
+ type: object
+ properties:
+ attribute_key:
+ type: string
+ description: filter attribute name
+ filter_operator:
+ type: string
+ description: filter operator name
+ enum: [equal_to, not_equal_to, contains, does_not_contain]
+ values:
+ type: array
+ items:
+ type: string
+ description: array of the attribute values to filter
+ query_operator:
+ type: string
+ description: query operator name
+ enum: [AND, OR]
+ example:
+ - attribute_key: 'name'
+ filter_operator: 'equal_to'
+ values: ['en']
+ query_operator: 'AND'
+ - attribute_key: 'country_code'
+ filter_operator: 'equal_to'
+ values: ['us']
+ query_operator: null
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contacts_list_response'
+ '400':
+ description: Bad Request Error
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/labels.yml b/swagger/paths/application/contacts/labels.yml
new file mode 100644
index 000000000..a764e36b2
--- /dev/null
+++ b/swagger/paths/application/contacts/labels.yml
@@ -0,0 +1,79 @@
+parameters:
+ - $ref: '#/components/parameters/account_id'
+ - name: id
+ in: path
+ required: true
+ schema:
+ type: number
+ description: ID of the contact
+
+get:
+ tags:
+ - Contact Labels
+ operationId: list-all-labels-of-a-contact
+ summary: List Labels
+ description: Lists all the labels of a contact
+ security:
+ - userApiKey: []
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_labels'
+ '401':
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Contact not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+
+post:
+ tags:
+ - Contact Labels
+ operationId: contact-add-labels
+ summary: Add Labels
+ description: Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.
+ security:
+ - userApiKey: []
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - labels
+ properties:
+ labels:
+ type: array
+ description: Array of labels (comma-separated strings)
+ items:
+ type: string
+ example: ['support', 'billing']
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_labels'
+ '401':
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Contact not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/labels/create.yml b/swagger/paths/application/contacts/labels/create.yml
deleted file mode 100644
index 01821d688..000000000
--- a/swagger/paths/application/contacts/labels/create.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-tags:
- - Contact Labels
-operationId: contact-add-labels
-summary: Add Labels
-description: Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- properties:
- labels:
- type: array
- description: Array of labels (comma-separated strings)
- items:
- type: string
-responses:
- 200:
- description: Success
- schema:
- $ref: '#/definitions/contact_labels'
- 404:
- description: Contact not found
- 401:
- description: Unauthorized
diff --git a/swagger/paths/application/contacts/labels/index.yml b/swagger/paths/application/contacts/labels/index.yml
deleted file mode 100644
index ad3c7ff81..000000000
--- a/swagger/paths/application/contacts/labels/index.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-tags:
- - Contact Labels
-operationId: list-all-labels-of-a-contact
-summary: List Labels
-description: Lists all the labels of a contact
-responses:
- 200:
- description: Success
- schema:
- $ref: '#/definitions/contact_labels'
- 404:
- description: Contact not found
- 401:
- description: Unauthorized
diff --git a/swagger/paths/application/contacts/list_create.yml b/swagger/paths/application/contacts/list_create.yml
index 4329ed3b7..eb5754a15 100644
--- a/swagger/paths/application/contacts/list_create.yml
+++ b/swagger/paths/application/contacts/list_create.yml
@@ -2,21 +2,27 @@ get:
tags:
- Contacts
operationId: contactList
- description: Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number
+ description: Listing all the resolved contacts with pagination (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number
summary: List Contacts
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/contact_sort_param'
- - $ref: '#/parameters/page'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/contact_sort_param'
+ - $ref: '#/components/parameters/page'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/contact_list'
- 400:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contacts_list_response'
+ '400':
description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
post:
tags:
@@ -24,19 +30,26 @@ post:
operationId: contactCreate
description: Create a new Contact
summary: Create Contact
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/contact_create'
+ - $ref: '#/components/parameters/account_id'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contact_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/extended_contact'
- 400:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/extended_contact'
+ '400':
description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/contacts/search.yml b/swagger/paths/application/contacts/search.yml
index 63cc11903..61075dc00 100644
--- a/swagger/paths/application/contacts/search.yml
+++ b/swagger/paths/application/contacts/search.yml
@@ -4,23 +4,27 @@ get:
operationId: contactSearch
description: Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number
summary: Search Contacts
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: q
in: query
- type: string
+ schema:
+ type: string
description: Search using contact `name`, `identifier`, `email` or `phone number`
- - $ref: '#/parameters/contact_sort_param'
- - $ref: '#/parameters/page'
+ - $ref: '#/components/parameters/contact_sort_param'
+ - $ref: '#/components/parameters/page'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- properties:
- payload:
- $ref: '#/definitions/contact_list'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/contacts_list_response'
+ '401':
description: Authentication error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/assignments.yml b/swagger/paths/application/conversation/assignments.yml
index a67ce59ad..49b7022db 100644
--- a/swagger/paths/application/conversation/assignments.yml
+++ b/swagger/paths/application/conversation/assignments.yml
@@ -1,30 +1,42 @@
tags:
- - Conversation Assignment
+ - Conversation Assignments
operationId: assign-a-conversation
summary: Assign Conversation
description: Assign a conversation to an agent or a team
security:
- userApiKey: []
- agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- properties:
- assignee_id:
- type: number
- description: Id of the assignee user
- team_id:
- type: number
- description: Id of the team. If the assignee_id is present, this param would be ignored
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ assignee_id:
+ type: number
+ description: Id of the assignee user
+ example: 1
+ team_id:
+ type: number
+ description: Id of the team. If the assignee_id is present, this param would be ignored
+ example: 1
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/user'
- 404:
- description: Conversation not found
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/custom_attributes.yml b/swagger/paths/application/conversation/custom_attributes.yml
index bfd416138..6e5786742 100644
--- a/swagger/paths/application/conversation/custom_attributes.yml
+++ b/swagger/paths/application/conversation/custom_attributes.yml
@@ -5,32 +5,41 @@ summary: Update Custom Attributes
description: Updates the custom attributes of a conversation
security:
- userApiKey: []
- - agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - custom_attributes
- properties:
- custom_attributes:
- type: object
- description: The custom attributes to be set for the conversation
- example:
- order_id: "12345"
- previous_conversation: "67890"
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - custom_attributes
+ properties:
+ custom_attributes:
+ type: object
+ description: The custom attributes to be set for the conversation
+ example:
+ order_id: '12345'
+ previous_conversation: '67890'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- properties:
- custom_attributes:
+ content:
+ application/json:
+ schema:
type: object
- description: The custom attributes of the conversation
- 404:
+ properties:
+ custom_attributes:
+ type: object
+ description: The custom attributes of the conversation
+ '401':
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Conversation not found
- 401:
- description: Unauthorized
\ No newline at end of file
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/filter.yml b/swagger/paths/application/conversation/filter.yml
index 4ee5f5d54..fdb318f6a 100644
--- a/swagger/paths/application/conversation/filter.yml
+++ b/swagger/paths/application/conversation/filter.yml
@@ -5,54 +5,59 @@ description: Filter conversations with custom filter options and pagination
summary: Conversations Filter
security:
- userApiKey: []
- - agentBotApiKey: []
parameters:
- name: page
in: query
- type: integer
- - name: body
- in: body
- required: true
schema:
- type: object
- properties:
- payload:
- type: array
- items:
- type: object
- properties:
- attribute_key:
- type: string
- description: filter attribute name
- filter_operator:
- type: string
- description: filter operator name
- enum: [ equal_to, not_equal_to, contains, does_not_contain ]
- values:
- type: array
- items:
+ type: number
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ items:
+ type: object
+ properties:
+ attribute_key:
type: string
- description: array of the attribute values to filter
- query_operator:
- type: string
- description: query operator name
- enum: [ AND, OR ]
- example:
- - attribute_key: 'browser_language'
- filter_operator: 'not_eq'
- values: ['en']
- query_operator: 'AND'
- - attribute_key: 'status'
- filter_operator: 'eq'
- values: ['pending']
- query_operator: null
+ description: filter attribute name
+ filter_operator:
+ type: string
+ description: filter operator name
+ enum: [equal_to, not_equal_to, contains, does_not_contain]
+ values:
+ type: array
+ items:
+ type: string
+ description: array of the attribute values to filter
+ query_operator:
+ type: string
+ description: query operator name
+ enum: [AND, OR]
+ example:
+ - attribute_key: 'browser_language'
+ filter_operator: 'not_equal_to'
+ values: ['en']
+ query_operator: 'AND'
+ - attribute_key: 'status'
+ filter_operator: 'equal_to'
+ values: ['pending']
+ query_operator: null
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_list'
- 400:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_list'
+ '400':
description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/index.yml b/swagger/paths/application/conversation/index.yml
index 6980eb2bd..e58659530 100644
--- a/swagger/paths/application/conversation/index.yml
+++ b/swagger/paths/application/conversation/index.yml
@@ -1,5 +1,5 @@
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
tags:
@@ -7,138 +7,98 @@ get:
operationId: conversationList
description: List all the conversations with pagination
summary: Conversations List
+ security:
+ - userApiKey: []
parameters:
- name: assignee_type
in: query
- type: string
- enum: ['me', 'unassigned', 'all', 'assigned']
- default: 'all'
+ schema:
+ type: string
+ enum: ['me', 'unassigned', 'all', 'assigned']
+ default: 'all'
description: Filter conversations by assignee type.
- name: status
in: query
- type: string
- enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
- default: 'open'
+ schema:
+ type: string
+ enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
+ default: 'open'
description: Filter by conversation status.
- name: q
in: query
- type: string
+ schema:
+ type: string
description: Filters conversations with messages containing the search term
- name: inbox_id
in: query
- type: integer
+ schema:
+ type: integer
- name: team_id
in: query
- type: integer
+ schema:
+ type: integer
- name: labels
in: query
- type: array
- items:
- type: string
+ schema:
+ type: array
+ items:
+ type: string
- name: page
in: query
- type: integer
- default: 1
+ schema:
+ type: integer
+ default: 1
description: paginate through conversations
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_list'
- 400:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_list'
+ '400':
description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
post:
tags:
- Conversations
operationId: newConversation
summary: Create New Conversation
- description: "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://github.com/chatwoot/chatwoot/wiki/Building-on-Top-of-Chatwoot:-Importing-Existing-Contacts-and-Creating-Conversations"
+ description: "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://www.chatwoot.com/hc/user-guide/articles/1677839703-how-to-create-an-api-channel-inbox#send-messages-to-the-api-channel"
security:
- userApiKey: []
- agentBotApiKey: []
- parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - source_id
- - inbox_id
- properties:
- source_id:
- type: string
- description: Conversation source id
- inbox_id:
- type: string
- description: "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email "
- contact_id:
- type: string
- description: Contact Id for which conversation is created
- additional_attributes:
- type: object
- description: Lets you specify attributes like browser information
- custom_attributes:
- type: object
- description: The object to save custom attributes for conversation, accepts custom attributes key and value
- example: { attribute_key: attribute_value, priority_conversation_number: 3 }
- status:
- type: string
- enum: ['open', 'resolved', 'pending']
- description: Specify the conversation whether it's pending, open, closed
- assignee_id:
- type: string
- description: Agent Id for assigning a conversation to an agent
- team_id:
- type: string
- description: Team Id for assigning a conversation to a team
- message:
- type: object
- description: The initial message to be sent to the conversation
- required: ['content']
- properties:
- content:
- type: string
- description: The content of the message
- template_params:
- type: object
- description: The template params for the message in case of whatsapp Channel
- properties:
- name:
- type: string
- description: Name of the template
- example: 'sample_issue_resolution'
- category:
- type: string
- description: Category of the template
- example: UTILITY
- language:
- type: string
- description: Language of the template
- example: en_US
- processed_params:
- type: object
- description: The processed param values for template variables in template
- example:
- 1: "Chatwoot"
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- properties:
- id:
- type: number
- description: ID of the conversation
- account_id:
- type: number
- description: Account Id
- inbox_id:
- type: number
- description: ID of the inbox
- 403:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ id:
+ type: number
+ description: ID of the conversation
+ account_id:
+ type: number
+ description: Account Id
+ inbox_id:
+ type: number
+ description: ID of the inbox
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/labels/create.yml b/swagger/paths/application/conversation/labels/create.yml
index 0f686ee24..6df685ccd 100644
--- a/swagger/paths/application/conversation/labels/create.yml
+++ b/swagger/paths/application/conversation/labels/create.yml
@@ -1,26 +1,41 @@
tags:
- - Conversation Labels
+ - Conversations
operationId: conversation-add-labels
summary: Add Labels
+security:
+ - userApiKey: []
description: Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- properties:
- labels:
- type: array
- description: Array of labels (comma-separated strings)
- items:
- type: string
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - labels
+ properties:
+ labels:
+ type: array
+ description: Array of labels (comma-separated strings)
+ items:
+ type: string
+ example: ['support', 'billing']
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_labels'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_labels'
+ '404':
description: Conversation not found
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/labels/index.yml b/swagger/paths/application/conversation/labels/index.yml
index 107fc0132..5c8b3e597 100644
--- a/swagger/paths/application/conversation/labels/index.yml
+++ b/swagger/paths/application/conversation/labels/index.yml
@@ -1,14 +1,26 @@
tags:
- - Conversation Labels
+ - Conversations
operationId: list-all-labels-of-a-conversation
summary: List Labels
+security:
+ - userApiKey: []
description: Lists all the labels of a conversation
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_labels'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_labels'
+ '404':
description: Conversation not found
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/messages/create.yml b/swagger/paths/application/conversation/messages/create.yml
index 4ab9e27a0..f8cd35f3c 100644
--- a/swagger/paths/application/conversation/messages/create.yml
+++ b/swagger/paths/application/conversation/messages/create.yml
@@ -6,20 +6,30 @@ description: Create a new message in the conversation
security:
- userApiKey: []
- agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/conversation_message_create'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_message_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/message'
- 404:
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/generic_id'
+ - $ref: '#/components/schemas/message'
+ '404':
description: Conversation not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/messages/create_attachment.yml b/swagger/paths/application/conversation/messages/create_attachment.yml
index 594f9a819..63acd0aa5 100644
--- a/swagger/paths/application/conversation/messages/create_attachment.yml
+++ b/swagger/paths/application/conversation/messages/create_attachment.yml
@@ -3,46 +3,55 @@ post:
- Messages
operationId: conversationNewMessageAttachment
summary: Create New Message Attachment
- description: Create an attachment message. Refer to this discussion if you have any further doubts. https://github.com/chatwoot/chatwoot/discussions/1809#discussioncomment-1211845
- consumes:
- - multipart/form-data
+ description: Create an attachment message.
security:
- userApiKey: []
- - agentBotApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
- required: true
- - in: formData
- name: content
- type: string
- description: The content of the message
- required: true
- - in: formData
- name: message_type
- type: string
- enum: ['outgoing', 'incoming']
- - in: formData
- name: private
- type: boolean
- description: Flag to identify if it is a private note
- - in: formData
- name: attachments[]
- type: array
- description: The files to be uploaded.
- items:
- type: string
- format: binary
-
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
+ requestBody:
+ required: true
+ content:
+ multipart/form-data:
+ schema:
+ type: object
+ required:
+ - content
+ properties:
+ content:
+ type: string
+ description: The content of the message
+ message_type:
+ type: string
+ enum: ['outgoing', 'incoming']
+ private:
+ type: boolean
+ description: Flag to identify if it is a private note
+ attachments:
+ type: array
+ description: The files to be uploaded.
+ items:
+ type: string
+ format: binary
responses:
- 200:
+ '200':
description: Success
- schema:
- allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/message'
- 404:
+ content:
+ application/json:
+ schema:
+ allOf:
+ - $ref: '#/components/schemas/generic_id'
+ - $ref: '#/components/schemas/message'
+ '404':
description: Conversation not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/messages/delete.yml b/swagger/paths/application/conversation/messages/delete.yml
index f038074c7..73b1e495b 100644
--- a/swagger/paths/application/conversation/messages/delete.yml
+++ b/swagger/paths/application/conversation/messages/delete.yml
@@ -2,11 +2,21 @@ tags:
- Messages
operationId: delete-a-message
summary: Delete a message
+security:
+ - userApiKey: []
description: Delete a message and it's attachments from the conversation.
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The message or conversation does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/messages/index.yml b/swagger/paths/application/conversation/messages/index.yml
index d99e8393b..02693a244 100644
--- a/swagger/paths/application/conversation/messages/index.yml
+++ b/swagger/paths/application/conversation/messages/index.yml
@@ -2,18 +2,50 @@ tags:
- Messages
operationId: list-all-messages
summary: Get messages
+security:
+ - userApiKey: []
description: List all messages of a conversation
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: Array of messages
- items:
- allOf:
- - $ref: '#/definitions/generic_id'
- - $ref: '#/definitions/message'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ meta:
+ type: object
+ properties:
+ labels:
+ type: array
+ items:
+ type: string
+ additional_attributes:
+ type: object
+ contact:
+ $ref: '#/components/schemas/contact'
+ assignee:
+ $ref: '#/components/schemas/agent'
+ agent_last_seen_at:
+ type: string
+ format: date-time
+ assignee_last_seen_at:
+ type: string
+ format: date-time
+ payload:
+ type: array
+ description: Array of messages
+ items:
+ $ref: '#/components/schemas/message'
+ '404':
description: Conversation not found
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/meta.yml b/swagger/paths/application/conversation/meta.yml
index 327fb702e..811ebbf5e 100644
--- a/swagger/paths/application/conversation/meta.yml
+++ b/swagger/paths/application/conversation/meta.yml
@@ -1,5 +1,5 @@
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
tags:
@@ -7,47 +7,58 @@ get:
operationId: conversationListMeta
description: Get open, unassigned and all Conversation counts
summary: Get Conversation Counts
+ security:
+ - userApiKey: []
parameters:
- name: status
in: query
- type: string
- enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
- default: 'open'
+ schema:
+ type: string
+ enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
+ default: 'open'
description: Filter by conversation status.
- name: q
in: query
- type: string
+ schema:
+ type: string
description: Filters conversations with messages containing the search term
- name: inbox_id
in: query
- type: integer
+ schema:
+ type: integer
- name: team_id
in: query
- type: integer
+ schema:
+ type: integer
- name: labels
in: query
- type: array
- items:
- type: string
+ schema:
+ type: array
+ items:
+ type: string
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- properties:
- meta:
+ content:
+ application/json:
+ schema:
type: object
properties:
- mine_count:
- type: number
- unassigned_count:
- type: number
- assigned_count:
- type: number
- all_count:
- type: number
- 400:
+ meta:
+ type: object
+ properties:
+ mine_count:
+ type: number
+ unassigned_count:
+ type: number
+ assigned_count:
+ type: number
+ all_count:
+ type: number
+ '400':
description: Bad Request Error
- schema:
- $ref: '#/definitions/bad_request_error'
\ No newline at end of file
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/show.yml b/swagger/paths/application/conversation/show.yml
index 56c3a292b..a57c36051 100644
--- a/swagger/paths/application/conversation/show.yml
+++ b/swagger/paths/application/conversation/show.yml
@@ -2,13 +2,25 @@ tags:
- Conversations
operationId: get-details-of-a-conversation
summary: Conversation Details
+security:
+ - userApiKey: []
description: Get all details regarding a conversation with all messages in the conversation
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_show'
- 404:
- description: Conversation not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_show'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/toggle_priority.yml b/swagger/paths/application/conversation/toggle_priority.yml
index 22a80c891..7ae3c252f 100644
--- a/swagger/paths/application/conversation/toggle_priority.yml
+++ b/swagger/paths/application/conversation/toggle_priority.yml
@@ -6,23 +6,32 @@ description: Toggles the priority of conversation
security:
- userApiKey: []
- agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - priority
- properties:
- priority:
- type: string
- enum: ["urgent", "high", "medium", "low", "none"]
- description: "The priority of the conversation"
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - priority
+ properties:
+ priority:
+ type: string
+ enum: ['urgent', 'high', 'medium', 'low', 'none']
+ description: 'The priority of the conversation'
+ example: 'high'
responses:
- 200:
+ '200':
description: Success
- 404:
- description: Conversation not found
- 401:
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/toggle_status.yml b/swagger/paths/application/conversation/toggle_status.yml
index 20b18d6aa..9c6f9ee6a 100644
--- a/swagger/paths/application/conversation/toggle_status.yml
+++ b/swagger/paths/application/conversation/toggle_status.yml
@@ -6,25 +6,36 @@ description: Toggles the status of the conversation between open and resolved
security:
- userApiKey: []
- agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - status
- properties:
- status:
- type: string
- enum: ["open", "resolved", "pending"]
- description: The status of the conversation
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - status
+ properties:
+ status:
+ type: string
+ enum: ['open', 'resolved', 'pending']
+ description: The status of the conversation
+ example: open
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/conversation_status_toggle'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_status_toggle'
+ '404':
description: Conversation not found
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/update.yml b/swagger/paths/application/conversation/update.yml
index 3add02635..fbe8e668b 100644
--- a/swagger/paths/application/conversation/update.yml
+++ b/swagger/paths/application/conversation/update.yml
@@ -6,24 +6,34 @@ description: Update Conversation Attributes
security:
- userApiKey: []
- agentBotApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- properties:
- priority:
- type: string
- enum: ["urgent", "high", "medium", "low", "none"]
- description: "The priority of the conversation"
- sla_policy_id:
- type: number
- description: "The ID of the SLA policy (Available only in Enterprise edition)"
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ priority:
+ type: string
+ enum: ['urgent', 'high', 'medium', 'low', 'none']
+ description: 'The priority of the conversation'
+ example: 'high'
+ sla_policy_id:
+ type: number
+ description: 'The ID of the SLA policy (Available only in Enterprise edition)'
+ example: 1
responses:
- 200:
+ '200':
description: Success
- 404:
- description: Conversation not found
- 401:
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/conversation/update_last_seen.yml b/swagger/paths/application/conversation/update_last_seen.yml
index 0f542dd7f..a81f6f219 100644
--- a/swagger/paths/application/conversation/update_last_seen.yml
+++ b/swagger/paths/application/conversation/update_last_seen.yml
@@ -3,6 +3,8 @@ post:
- Conversations
operationId: conversationUpdateLastSeen
summary: Update Last Seen
+ security:
+ - userApiKey: []
description: Updates the last seen of the conversation so that conversations will have the bubbles in the agents screen
parameters:
- name: id
@@ -11,9 +13,17 @@ post:
description: ID of the conversation
required: true
responses:
- 200:
+ '200':
description: Success
- 404:
- description: Contact not found
- 403:
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Contact not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_attributes/create.yml b/swagger/paths/application/custom_attributes/create.yml
index fa01fc8e4..615dd6c74 100644
--- a/swagger/paths/application/custom_attributes/create.yml
+++ b/swagger/paths/application/custom_attributes/create.yml
@@ -5,16 +5,22 @@ summary: Add a new custom attribute
description: Add a new custom attribute to account
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/custom_attribute_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_attribute_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/custom_attribute'
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_attribute'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_attributes/delete.yml b/swagger/paths/application/custom_attributes/delete.yml
index 0c9aaedee..313425a71 100644
--- a/swagger/paths/application/custom_attributes/delete.yml
+++ b/swagger/paths/application/custom_attributes/delete.yml
@@ -6,16 +6,25 @@ description: Remove a custom attribute from account
security:
- userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the custom attribute to be deleted
responses:
- 200:
+ '200':
description: Success
- 404:
+ '404':
description: Custom attribute not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_attributes/index.yml b/swagger/paths/application/custom_attributes/index.yml
index a3a91144b..2d61a0925 100644
--- a/swagger/paths/application/custom_attributes/index.yml
+++ b/swagger/paths/application/custom_attributes/index.yml
@@ -3,22 +3,29 @@ tags:
operationId: get-account-custom-attribute
summary: List all custom attributes in an account
parameters:
- - name: attribute_model
- in: query
+ - name: attribute_model
+ in: query
+ schema:
type: string
enum: ['0', '1']
- description: conversation_attribute(0)/contact_attribute(1)
- required: true
+ description: conversation_attribute(0)/contact_attribute(1)
+ required: true
description: Get details of custom attributes in an Account
security:
- userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all custom attributes'
- items:
- $ref: '#/definitions/custom_attribute'
- 403:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all custom attributes'
+ items:
+ $ref: '#/components/schemas/custom_attribute'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_attributes/show.yml b/swagger/paths/application/custom_attributes/show.yml
index 8449ba9be..9910f7f85 100644
--- a/swagger/paths/application/custom_attributes/show.yml
+++ b/swagger/paths/application/custom_attributes/show.yml
@@ -2,20 +2,33 @@ tags:
- Custom Attributes
operationId: get-details-of-a-single-custom-attribute
summary: Get a custom attribute details
+security:
+ - userApiKey: []
description: Get the details of a custom attribute in the account
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the custom attribute to be updated.
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/custom_attribute'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_attribute'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given attribute ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_attributes/update.yml b/swagger/paths/application/custom_attributes/update.yml
index 4b69f21bd..d3ccc6af1 100644
--- a/swagger/paths/application/custom_attributes/update.yml
+++ b/swagger/paths/application/custom_attributes/update.yml
@@ -8,21 +8,33 @@ security:
parameters:
- in: path
name: id
- type: integer
+ schema:
+ type: integer
required: true
description: The ID of the custom attribute to be updated.
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/custom_attribute_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_attribute_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- description: 'The updated custom attribute'
- $ref: '#/definitions/custom_attribute'
- 404:
+ content:
+ application/json:
+ schema:
+ description: 'The updated custom attribute'
+ $ref: '#/components/schemas/custom_attribute'
+ '404':
description: Agent not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_filters/create.yml b/swagger/paths/application/custom_filters/create.yml
index 9d9534976..5b7a6ca80 100644
--- a/swagger/paths/application/custom_filters/create.yml
+++ b/swagger/paths/application/custom_filters/create.yml
@@ -4,16 +4,25 @@ operationId: create-a-custom-filter
summary: Create a custom filter
description: Create a custom filter in the account
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/custom_filter_create_update_payload'
+ - $ref: '#/components/parameters/account_id'
+security:
+ - userApiKey: []
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_filter_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/custom_filter'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_filter'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_filters/delete.yml b/swagger/paths/application/custom_filters/delete.yml
index e66748858..5553bbeae 100644
--- a/swagger/paths/application/custom_filters/delete.yml
+++ b/swagger/paths/application/custom_filters/delete.yml
@@ -2,11 +2,21 @@ tags:
- Custom Filters
operationId: delete-a-custom-filter
summary: Delete a custom filter
+security:
+ - userApiKey: []
description: Delete a custom filter from the account
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The custom filter does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_filters/index.yml b/swagger/paths/application/custom_filters/index.yml
index b77949dc3..0c4f7578f 100644
--- a/swagger/paths/application/custom_filters/index.yml
+++ b/swagger/paths/application/custom_filters/index.yml
@@ -3,13 +3,21 @@ tags:
operationId: list-all-filters
summary: List all custom filters
description: List all custom filters in a category of a user
+security:
+ - userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of custom filters'
- items:
- $ref: '#/definitions/custom_filter'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of custom filters'
+ items:
+ $ref: '#/components/schemas/custom_filter'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_filters/show.yml b/swagger/paths/application/custom_filters/show.yml
index 14de07d85..cf298a4ad 100644
--- a/swagger/paths/application/custom_filters/show.yml
+++ b/swagger/paths/application/custom_filters/show.yml
@@ -3,12 +3,24 @@ tags:
operationId: get-details-of-a-single-custom-filter
summary: Get a custom filter details
description: Get the details of a custom filter in the account
+security:
+ - userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/custom_filter'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_filter'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given team ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/custom_filters/update.yml b/swagger/paths/application/custom_filters/update.yml
index a058b81f8..19db632d2 100644
--- a/swagger/paths/application/custom_filters/update.yml
+++ b/swagger/paths/application/custom_filters/update.yml
@@ -2,17 +2,25 @@ tags:
- Custom Filters
operationId: update-a-custom-filter
summary: Update a custom filter
+security:
+ - userApiKey: []
description: Update a custom filter's attributes
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/custom_filter_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_filter_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/custom_filter'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/custom_filter'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/create.yml b/swagger/paths/application/inboxes/create.yml
index 3d649e820..6f88b0d4a 100644
--- a/swagger/paths/application/inboxes/create.yml
+++ b/swagger/paths/application/inboxes/create.yml
@@ -4,48 +4,32 @@ post:
operationId: inboxCreation
summary: Create an inbox
description: You can create more than one website inbox in each account
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- type: object
- properties:
- name:
- type: string
- description: The name of the inbox
- avatar:
- type: string
- format: binary
- description: File for avatar image
- channel:
- type: object
- properties:
- type:
- type: string
- enum: ['web_widget']
- website_url:
- type: string
- description: URL at which the widget will be loaded
- welcome_title:
- type: string
- description: Welcome title to be displayed on the widget
- welcome_tagline:
- type: string
- description: Welcome tagline to be displayed on the widget
- agent_away_message:
- type: string
- description: A message which will be sent if there is not agent available. This is not available if agentbot is connected
- widget_color:
- type: string
- description: A Hex-color string used to customize the widget
+ - $ref: '#/components/parameters/account_id'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/inbox_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/inbox'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/inbox'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/get_agent_bot.yml b/swagger/paths/application/inboxes/get_agent_bot.yml
index 178151dd3..f10d6b41f 100644
--- a/swagger/paths/application/inboxes/get_agent_bot.yml
+++ b/swagger/paths/application/inboxes/get_agent_bot.yml
@@ -4,19 +4,32 @@ get:
operationId: getInboxAgentBot
summary: Show Inbox Agent Bot
description: See if an agent bot is associated to the Inbox
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the inbox
required: true
responses:
- 204:
+ '204':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '404':
description: Inbox not found, Agent bot not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/inbox_members/create.yml b/swagger/paths/application/inboxes/inbox_members/create.yml
index 9ca5641e6..47dcb8b2e 100644
--- a/swagger/paths/application/inboxes/inbox_members/create.yml
+++ b/swagger/paths/application/inboxes/inbox_members/create.yml
@@ -5,35 +5,54 @@ summary: Add a New Agent
description: Add a new Agent to Inbox
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
- inbox_id
- user_ids
- properties:
- inbox_id:
- type: string
- description: The ID of the inbox
- user_ids:
- type: array
- items:
+ properties:
+ inbox_id:
type: integer
- description: IDs of users to be added to the inbox
+ description: The ID of the inbox
+ example: 1
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be added to the inbox
+ example: [1]
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/definitions/agent'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/inbox_members/delete.yml b/swagger/paths/application/inboxes/inbox_members/delete.yml
index 78f1435b5..a8df7661a 100644
--- a/swagger/paths/application/inboxes/inbox_members/delete.yml
+++ b/swagger/paths/application/inboxes/inbox_members/delete.yml
@@ -5,30 +5,42 @@ summary: Remove an Agent from Inbox
description: Remove an Agent from Inbox
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - inbox_id
- - user_ids
- properties:
- inbox_id:
- type: string
- description: The ID of the inbox
- user_ids:
- type: array
- items:
- type: integer
- description: IDs of users to be deleted from the inbox
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - inbox_id
+ - user_ids
+ properties:
+ inbox_id:
+ type: string
+ description: The ID of the inbox
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be deleted from the inbox
responses:
- 200:
+ '200':
description: Success
- 404:
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/inbox_members/show.yml b/swagger/paths/application/inboxes/inbox_members/show.yml
index 57793f520..ec10a5f0b 100644
--- a/swagger/paths/application/inboxes/inbox_members/show.yml
+++ b/swagger/paths/application/inboxes/inbox_members/show.yml
@@ -6,16 +6,29 @@ description: Get Details of Agents in an Inbox
security:
- userApiKey: []
parameters:
- - $ref: '#/parameters/inbox_id'
+ - $ref: '#/components/parameters/inbox_id'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/definitions/agent'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/inbox_members/update.yml b/swagger/paths/application/inboxes/inbox_members/update.yml
index 483b8f6ab..728c2a028 100644
--- a/swagger/paths/application/inboxes/inbox_members/update.yml
+++ b/swagger/paths/application/inboxes/inbox_members/update.yml
@@ -5,35 +5,54 @@ summary: Update Agents in Inbox
description: All agents except the one passed in params will be removed
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - inbox_id
- - user_ids
- properties:
- inbox_id:
- type: string
- description: The ID of the inbox
- user_ids:
- type: array
- items:
- type: integer
- description: IDs of users to be added to the inbox
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - inbox_id
+ - user_ids
+ properties:
+ inbox_id:
+ type: string
+ description: The ID of the inbox
+ example: 1
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be added to the inbox
+ example: [1]
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/definitions/agent'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/index.yml b/swagger/paths/application/inboxes/index.yml
index 233488228..89abb6009 100644
--- a/swagger/paths/application/inboxes/index.yml
+++ b/swagger/paths/application/inboxes/index.yml
@@ -4,17 +4,32 @@ get:
operationId: listAllInboxes
summary: List all inboxes
description: List all inboxes available in the current account
+ security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of inboxes'
- items:
- $ref: '#/definitions/inbox'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of inboxes'
+ items:
+ $ref: '#/components/schemas/inbox'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/set_agent_bot.yml b/swagger/paths/application/inboxes/set_agent_bot.yml
index 56a37d165..bbd6a9e89 100644
--- a/swagger/paths/application/inboxes/set_agent_bot.yml
+++ b/swagger/paths/application/inboxes/set_agent_bot.yml
@@ -3,29 +3,42 @@ post:
- Inboxes
operationId: updateAgentBot
summary: Add or remove agent bot
+ security:
+ - userApiKey: []
description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the inbox
required: true
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - agent_bot
- properties:
- agent_bot:
- type: number
- description: 'Agent bot ID'
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - agent_bot
+ properties:
+ agent_bot:
+ type: number
+ description: 'Agent bot ID'
+ example: 1
responses:
- 204:
+ '204':
description: Success
- 404:
+ '404':
description: Inbox not found, Agent bot not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/show.yml b/swagger/paths/application/inboxes/show.yml
index 6bb2e84a5..5d145c56e 100644
--- a/swagger/paths/application/inboxes/show.yml
+++ b/swagger/paths/application/inboxes/show.yml
@@ -3,20 +3,33 @@ get:
- Inboxes
operationId: GetInbox
summary: Get an inbox
+ security:
+ - userApiKey: []
description: Get an inbox available in the current account
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the inbox
required: true
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/inbox'
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/inbox'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/inboxes/update.yml b/swagger/paths/application/inboxes/update.yml
index c5b3aaebf..e076dd532 100644
--- a/swagger/paths/application/inboxes/update.yml
+++ b/swagger/paths/application/inboxes/update.yml
@@ -3,58 +3,41 @@ patch:
- Inboxes
operationId: updateInbox
summary: Update Inbox
- description: Add avatar and disable auto assignment for an inbox
+ security:
+ - userApiKey: []
+ description: Update an existing inbox
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the inbox
required: true
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - enable_auto_assignment
- properties:
- name:
- type: string
- description: The name of the inbox
- enable_auto_assignment:
- type: boolean
- description: 'Enable Auto Assignment'
- avatar:
- type: string
- format: binary
- description: 'Image file for avatar'
- channel:
- type: object
- properties:
- website_url:
- type: string
- description: URL at which the widget will be loaded
- welcome_title:
- type: string
- description: Welcome title to be displayed on the widget
- welcome_tagline:
- type: string
- description: Welcome tagline to be displayed on the widget
- agent_away_message:
- type: string
- description: A message which will be sent if there is not agent available. This is not available if agentbot is connected
- widget_color:
- type: string
- description: A Hex-color string used to customize the widget
+ requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/inbox_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- description: 'Updated inbox object'
- $ref: '#/definitions/inbox'
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ description: 'Updated inbox object'
+ $ref: '#/components/schemas/inbox'
+ '404':
description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/integrations/apps/show.yml b/swagger/paths/application/integrations/apps/show.yml
index 16ce299fe..ab5403bd6 100644
--- a/swagger/paths/application/integrations/apps/show.yml
+++ b/swagger/paths/application/integrations/apps/show.yml
@@ -2,16 +2,31 @@ tags:
- Integrations
operationId: get-details-of-all-integrations
summary: List all the Integrations
+security:
+ - userApiKey: []
description: Get the details of all Integrations available for the account
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of Integration apps'
- items:
- $ref: '#/definitions/integrations_app'
- 401:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of Integration apps'
+ items:
+ $ref: '#/components/schemas/integrations_app'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Url not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/integrations/hooks/create.yml b/swagger/paths/application/integrations/hooks/create.yml
index 42bcb002e..11d43b140 100644
--- a/swagger/paths/application/integrations/hooks/create.yml
+++ b/swagger/paths/application/integrations/hooks/create.yml
@@ -3,17 +3,26 @@ tags:
operationId: create-an-integration-hook
summary: Create an integration hook
description: Create an integration hook
+security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/integrations_hook_create_payload'
+ - $ref: '#/components/parameters/account_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/integrations_hook_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/integrations_hook'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/integrations_hook'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/integrations/hooks/delete.yml b/swagger/paths/application/integrations/hooks/delete.yml
index 3e616613b..60172b5d8 100644
--- a/swagger/paths/application/integrations/hooks/delete.yml
+++ b/swagger/paths/application/integrations/hooks/delete.yml
@@ -1,15 +1,25 @@
tags:
- - Integrations
+ - Integrations
operationId: delete-an-integration-hook
summary: Delete an Integration Hook
description: Delete an Integration Hook
+security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/hook_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/hook_id'
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The hook does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/integrations/hooks/update.yml b/swagger/paths/application/integrations/hooks/update.yml
index 2cfd6877a..eaa80cf20 100644
--- a/swagger/paths/application/integrations/hooks/update.yml
+++ b/swagger/paths/application/integrations/hooks/update.yml
@@ -3,18 +3,27 @@ tags:
operationId: update-an-integrations-hook
summary: Update an Integration Hook
description: Update an Integration Hook
+security:
+ - userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/hook_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/integrations_hook_update_payload'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/hook_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/integrations_hook_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/integrations_hook'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/integrations_hook'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/portal/create.yml b/swagger/paths/application/portal/create.yml
index 187c20008..b08fc2931 100644
--- a/swagger/paths/application/portal/create.yml
+++ b/swagger/paths/application/portal/create.yml
@@ -5,16 +5,22 @@ summary: Add a new portal
description: Add a new portal to account
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/portal_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/portal'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal'
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/portal/index.yml b/swagger/paths/application/portal/index.yml
index ea56563a4..1c57fc7fb 100644
--- a/swagger/paths/application/portal/index.yml
+++ b/swagger/paths/application/portal/index.yml
@@ -3,17 +3,58 @@ tags:
operationId: get-portal
summary: List all portals in an account
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
description: Get details of portals in an Account
security:
- userApiKey: []
responses:
'200':
description: Success
- schema:
- type: array
- description: Array of all portals
- items:
- $ref: '#/definitions/portal'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal'
+ example:
+ payload:
+ - id: 4
+ color: "#1F93FF"
+ custom_domain: "chatwoot.help"
+ header_text: "Handbook"
+ homepage_link: "https://www.chatwoot.com"
+ name: "Handbook"
+ page_title: "Handbook"
+ slug: "handbook"
+ archived: false
+ account_id: 1
+ config:
+ allowed_locales:
+ - code: "en"
+ articles_count: 32
+ categories_count: 9
+ inbox:
+ id: 37
+ avatar_url: "https://example.com/avatar.png"
+ channel_id: 1
+ name: "Chatwoot"
+ channel_type: "Channel::WebWidget"
+ greeting_enabled: true
+ widget_color: "#1F93FF"
+ website_url: "chatwoot.com"
+ logo:
+ id: 19399916
+ portal_id: 4
+ file_type: "image/png"
+ account_id: 1
+ file_url: "https://example.com/logo.png"
+ blob_id: 21239614
+ filename: "square.png"
+ meta:
+ all_articles_count: 0
+ categories_count: 9
+ default_locale: "en"
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/portal/show.yml b/swagger/paths/application/portal/show.yml
new file mode 100644
index 000000000..20eb7e1f1
--- /dev/null
+++ b/swagger/paths/application/portal/show.yml
@@ -0,0 +1,79 @@
+tags:
+ - Help Center
+operationId: get-details-of-a-single-portal
+summary: Get a portal details
+description: Get the details of a portal in the account
+security:
+ - userApiKey: []
+parameters:
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/portal_id'
+responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal_single'
+ example:
+ payload:
+ id: 123
+ archived: false
+ color: "#1F93FF"
+ config:
+ allowed_locales:
+ - code: "en"
+ articles_count: 32
+ categories_count: 9
+ custom_domain: "chatwoot.help"
+ header_text: "Handbook"
+ homepage_link: "https://www.chatwoot.com"
+ name: "Handbook"
+ slug: "handbook"
+ page_title: "Handbook"
+ account_id: 123
+ inbox:
+ id: 123
+ name: "Chatwoot"
+ website_url: "chatwoot.com"
+ channel_type: "Channel::WebWidget"
+ avatar_url: "https://example.com/avatar.png"
+ widget_color: "#1F93FF"
+ website_token: "4cWzuf9i9jxN9tbnv8K9STKU"
+ enable_auto_assignment: true
+ web_widget_script: ""
+ welcome_title: "Hi there ! 🙌🏼"
+ welcome_tagline: "We make it simple to connect with us."
+ greeting_enabled: true
+ greeting_message: "Hey there 👋, Thank you for reaching out to us."
+ channel_id: 123
+ working_hours_enabled: true
+ enable_email_collect: true
+ csat_survey_enabled: true
+ timezone: "America/Los_Angeles"
+ business_name: "Chatwoot"
+ hmac_mandatory: true
+ logo:
+ id: 123
+ portal_id: 123
+ file_type: "image/png"
+ account_id: 123
+ file_url: "https://example.com/logo.png"
+ blob_id: 123
+ filename: "square.png"
+ meta:
+ all_articles_count: 32
+ categories_count: 9
+ default_locale: "en"
+ '401':
+ description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: The given portal ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
\ No newline at end of file
diff --git a/swagger/paths/application/portal/update.yml b/swagger/paths/application/portal/update.yml
index 8c6a74e85..0679a37d0 100644
--- a/swagger/paths/application/portal/update.yml
+++ b/swagger/paths/application/portal/update.yml
@@ -1,20 +1,85 @@
tags:
- Help Center
-operationId: update-new-portal-to-account
-summary: update a new portal
-description: update a new portal to account
+operationId: update-portal-to-account
+summary: Update a portal
+description: Update a portal to account
security:
- userApiKey: []
parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/portal_create_update_payload'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/portal_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal_create_update_payload'
responses:
'200':
description: Success
- schema:
- $ref: '#/definitions/portal'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/portal_single'
+ example:
+ payload:
+ id: 123
+ archived: false
+ color: "#1F93FF"
+ config:
+ allowed_locales:
+ - code: "en"
+ articles_count: 32
+ categories_count: 9
+ custom_domain: "chatwoot.help"
+ header_text: "Handbook"
+ homepage_link: "https://www.chatwoot.com"
+ name: "Handbook"
+ slug: "handbook"
+ page_title: "Handbook"
+ account_id: 123
+ inbox:
+ id: 123
+ name: "Chatwoot"
+ website_url: "chatwoot.com"
+ channel_type: "Channel::WebWidget"
+ avatar_url: "https://example.com/avatar.png"
+ widget_color: "#1F93FF"
+ website_token: "4cWzuf9i9jxN9tbnv8K9STKU"
+ enable_auto_assignment: true
+ web_widget_script: ""
+ welcome_title: "Hi there ! 🙌🏼"
+ welcome_tagline: "We make it simple to connect with us."
+ greeting_enabled: true
+ greeting_message: "Hey there 👋, Thank you for reaching out to us."
+ channel_id: 123
+ working_hours_enabled: true
+ enable_email_collect: true
+ csat_survey_enabled: true
+ timezone: "America/Los_Angeles"
+ business_name: "Chatwoot"
+ hmac_mandatory: true
+ logo:
+ id: 123
+ portal_id: 123
+ file_type: "image/png"
+ account_id: 123
+ file_url: "https://example.com/logo.png"
+ blob_id: 123
+ filename: "square.png"
+ meta:
+ all_articles_count: 32
+ categories_count: 9
+ default_locale: "en"
'403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Portal not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/reports/conversation/account.yml b/swagger/paths/application/reports/conversation/account.yml
index 28aac72e7..d0fa9a3c3 100644
--- a/swagger/paths/application/reports/conversation/account.yml
+++ b/swagger/paths/application/reports/conversation/account.yml
@@ -2,22 +2,33 @@ tags:
- Reports
operationId: get-account-conversation-metrics
summary: Account Conversation Metrics
+security:
+ - userApiKey: []
description: Get conversation metrics for Account
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- description: 'Object of account conversation metrics'
- properties:
- open:
- type: number
- unattended:
- type: number
- unassigned:
- type: number
-
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ description: 'Object of account conversation metrics'
+ properties:
+ open:
+ type: number
+ unattended:
+ type: number
+ unassigned:
+ type: number
+ '404':
description: reports not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/reports/conversation/agent.yml b/swagger/paths/application/reports/conversation/agent.yml
index 90f433e4a..3cbf48403 100644
--- a/swagger/paths/application/reports/conversation/agent.yml
+++ b/swagger/paths/application/reports/conversation/agent.yml
@@ -2,17 +2,28 @@ tags:
- Reports
operationId: get-agent-conversation-metrics
summary: Agent Conversation Metrics
+security:
+ - userApiKey: []
description: Get conversation metrics for Agent
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of agent based conversation metrics'
- items:
- $ref: '#/definitions/agent_conversation_metrics'
-
- 404:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of agent based conversation metrics'
+ items:
+ $ref: '#/components/schemas/agent_conversation_metrics'
+ '404':
description: reports not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/reports/index.yml b/swagger/paths/application/reports/index.yml
index 3d86df38d..73aca86ea 100644
--- a/swagger/paths/application/reports/index.yml
+++ b/swagger/paths/application/reports/index.yml
@@ -2,21 +2,33 @@ tags:
- Reports
operationId: list-all-conversation-statistics
summary: Get Account reports
+security:
+ - userApiKey: []
description: Get Account reports for a specific type, metric and date range
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of date based conversation statistics'
- items:
- type: object
- properties:
- value:
- type: string
- timestamp:
- type: number
- 404:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of date based conversation statistics'
+ items:
+ type: object
+ properties:
+ value:
+ type: string
+ timestamp:
+ type: number
+ '404':
description: reports not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/reports/summary.yml b/swagger/paths/application/reports/summary.yml
index f9538a9f8..20497cc52 100644
--- a/swagger/paths/application/reports/summary.yml
+++ b/swagger/paths/application/reports/summary.yml
@@ -2,14 +2,26 @@ tags:
- Reports
operationId: list-all-conversation-statistics-summary
summary: Get Account reports summary
+security:
+ - userApiKey: []
description: Get Account reports summary for a specific type and date range
responses:
- 200:
+ '200':
description: Success
- schema:
- description: 'Object of summary metrics'
- $ref: '#/definitions/account_summary'
- 404:
+ content:
+ application/json:
+ schema:
+ description: 'Object of summary metrics'
+ $ref: '#/components/schemas/account_summary'
+ '404':
description: reports not found
- 403:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/team_members/create.yml b/swagger/paths/application/team_members/create.yml
index 724769319..bea148f73 100644
--- a/swagger/paths/application/team_members/create.yml
+++ b/swagger/paths/application/team_members/create.yml
@@ -5,31 +5,46 @@ summary: Add a New Agent
description: Add a new Agent to Team
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
- user_ids
- properties:
- user_ids:
- type: array
- items:
- type: integer
- description: IDs of users to be added to the team
+ properties:
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be added to the team
+ example: [1]
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/definitions/agent'
- 404:
- description: Team not found
- 403:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Team not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/team_members/delete.yml b/swagger/paths/application/team_members/delete.yml
index ac7dbb451..99deed83d 100644
--- a/swagger/paths/application/team_members/delete.yml
+++ b/swagger/paths/application/team_members/delete.yml
@@ -5,27 +5,38 @@ summary: Remove an Agent from Team
description: Remove an Agent from Team
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - team_id
- - user_ids
- properties:
- user_ids:
- type: array
- items:
- type: integer
- description: IDs of users to be deleted from the team
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - user_ids
+ properties:
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be deleted from the team
responses:
- 200:
+ '200':
description: Success
- 404:
- description: Team not found
- 403:
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Team not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/team_members/index.yml b/swagger/paths/application/team_members/index.yml
index c57705223..dfa505363 100644
--- a/swagger/paths/application/team_members/index.yml
+++ b/swagger/paths/application/team_members/index.yml
@@ -6,17 +6,27 @@ description: Get Details of Agents in an Team
security:
- userApiKey: []
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/team_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/team_id'
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all agents in the team'
- items:
- $ref: '#/definitions/agent'
- 404:
- description: Inbox not found
- 403:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all agents in the team'
+ items:
+ $ref: '#/components/schemas/agent'
+ '403':
description: Access denied
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Team not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/team_members/update.yml b/swagger/paths/application/team_members/update.yml
index 81034b9c7..34a2de82f 100644
--- a/swagger/paths/application/team_members/update.yml
+++ b/swagger/paths/application/team_members/update.yml
@@ -5,31 +5,46 @@ summary: Update Agents in Team
description: All agents except the one passed in params will be removed
security:
- userApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - user_ids
- properties:
- user_ids:
- type: array
- items:
- type: integer
- description: IDs of users to be added to the team
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ required:
+ - user_ids
+ properties:
+ user_ids:
+ type: array
+ items:
+ type: integer
+ description: IDs of users to be added to the team
+ example: [1]
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of all agents in the team'
- items:
- $ref: '#/definitions/agent'
- 404:
- description: Team not found
- 403:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of all agents in the team'
+ items:
+ $ref: '#/components/schemas/agent'
+ '403':
description: Access denied
- 422:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
+ description: Team not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '422':
description: User must exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/teams/create.yml b/swagger/paths/application/teams/create.yml
index 2ec066738..b96068b11 100644
--- a/swagger/paths/application/teams/create.yml
+++ b/swagger/paths/application/teams/create.yml
@@ -2,18 +2,27 @@ tags:
- Teams
operationId: create-a-team
summary: Create a team
+security:
+ - userApiKey: []
description: Create a team in the account
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/team_create_update_payload'
+ - $ref: '#/components/parameters/account_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/team_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/team'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/team'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/teams/delete.yml b/swagger/paths/application/teams/delete.yml
index 7c5698b99..eae30ecba 100644
--- a/swagger/paths/application/teams/delete.yml
+++ b/swagger/paths/application/teams/delete.yml
@@ -2,11 +2,21 @@ tags:
- Teams
operationId: delete-a-team
summary: Delete a team
+security:
+ - userApiKey: []
description: Delete a team from the account
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The team does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/teams/index.yml b/swagger/paths/application/teams/index.yml
index f93b6a553..85ac0ff8f 100644
--- a/swagger/paths/application/teams/index.yml
+++ b/swagger/paths/application/teams/index.yml
@@ -2,14 +2,22 @@ tags:
- Teams
operationId: list-all-teams
summary: List all teams
+security:
+ - userApiKey: []
description: List all teams available in the current account
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of teams'
- items:
- $ref: '#/definitions/team'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of teams'
+ items:
+ $ref: '#/components/schemas/team'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/teams/show.yml b/swagger/paths/application/teams/show.yml
index 485b4730b..15869beda 100644
--- a/swagger/paths/application/teams/show.yml
+++ b/swagger/paths/application/teams/show.yml
@@ -2,13 +2,25 @@ tags:
- Teams
operationId: get-details-of-a-single-team
summary: Get a team details
+security:
+ - userApiKey: []
description: Get the details of a team in the account
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/team'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/team'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given team ID does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/teams/update.yml b/swagger/paths/application/teams/update.yml
index 8afeddc02..5b620e888 100644
--- a/swagger/paths/application/teams/update.yml
+++ b/swagger/paths/application/teams/update.yml
@@ -2,17 +2,25 @@ tags:
- Teams
operationId: update-a-team
summary: Update a team
+security:
+ - userApiKey: []
description: Update a team's attributes
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/team_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/team_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/team'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/team'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/webhooks/create.yml b/swagger/paths/application/webhooks/create.yml
index e4d3053ee..81d7bbf1a 100644
--- a/swagger/paths/application/webhooks/create.yml
+++ b/swagger/paths/application/webhooks/create.yml
@@ -2,18 +2,27 @@ tags:
- Webhooks
operationId: create-a-webhook
summary: Add a webhook
+security:
+ - userApiKey: []
description: Add a webhook subscription to the account
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/webhook_create_update_payload'
+ - $ref: '#/components/parameters/account_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/webhook_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/webhook'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/webhook'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/webhooks/delete.yml b/swagger/paths/application/webhooks/delete.yml
index 525c22dfc..07cfdbaf8 100644
--- a/swagger/paths/application/webhooks/delete.yml
+++ b/swagger/paths/application/webhooks/delete.yml
@@ -2,11 +2,21 @@ tags:
- Webhooks
operationId: delete-a-webhook
summary: Delete a webhook
+security:
+ - userApiKey: []
description: Delete a webhook from the account
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ type: object
+ '404':
description: The webhook does not exist in the account
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/webhooks/index.yml b/swagger/paths/application/webhooks/index.yml
index f96fa00de..d385a9ad1 100644
--- a/swagger/paths/application/webhooks/index.yml
+++ b/swagger/paths/application/webhooks/index.yml
@@ -2,14 +2,22 @@ tags:
- Webhooks
operationId: list-all-webhooks
summary: List all webhooks
-description: List all webhooks in the account
+security:
+ - userApiKey: []
+description: List all webhooks in the account
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of webhook objects'
- items:
- $ref: '#/definitions/webhook'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of webhook objects'
+ items:
+ $ref: '#/components/schemas/webhook'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/application/webhooks/update.yml b/swagger/paths/application/webhooks/update.yml
index b395e7362..5e6a36782 100644
--- a/swagger/paths/application/webhooks/update.yml
+++ b/swagger/paths/application/webhooks/update.yml
@@ -2,18 +2,27 @@ tags:
- Webhooks
operationId: update-a-webhook
summary: Update a webhook object
+security:
+ - userApiKey: []
description: Update a webhook object in the account
parameters:
- - $ref: '#/parameters/account_id'
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/webhook_create_update_payload'
+ - $ref: '#/components/parameters/account_id'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/webhook_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/webhook'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/webhook'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/index.yml b/swagger/paths/index.yml
index 769f38c27..379b2eef0 100644
--- a/swagger/paths/index.yml
+++ b/swagger/paths/index.yml
@@ -7,7 +7,7 @@
$ref: ./platform/accounts/create.yml
/platform/api/v1/accounts/{account_id}:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: './platform/accounts/show.yml'
patch:
@@ -15,12 +15,11 @@
delete:
$ref: ./platform/accounts/delete.yml
-
# Account Users
/platform/api/v1/accounts/{account_id}/account_users:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: './platform/account_users/index.yml'
post:
@@ -37,7 +36,7 @@
$ref: ./platform/agent_bots/create.yml
/platform/api/v1/agent_bots/{id}:
parameters:
- - $ref: '#/parameters/agent_bot_id'
+ - $ref: '#/components/parameters/agent_bot_id'
get:
$ref: './platform/agent_bots/show.yml'
patch:
@@ -52,7 +51,7 @@
$ref: ./platform/users/create.yml
/platform/api/v1/users/{id}:
parameters:
- - $ref: '#/parameters/platform_user_id'
+ - $ref: '#/components/parameters/platform_user_id'
get:
$ref: './platform/users/show.yml'
patch:
@@ -61,11 +60,10 @@
$ref: ./platform/users/delete.yml
/platform/api/v1/users/{id}/login:
parameters:
- - $ref: '#/parameters/platform_user_id'
+ - $ref: '#/components/parameters/platform_user_id'
get:
$ref: './platform/users/login.yml'
-
# ---------------- end of platform path -----------#
# ------------ Public API routes ------------#
@@ -74,7 +72,7 @@
/public/api/v1/inboxes/{inbox_identifier}:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_inbox_identifier'
get:
$ref: './public/inboxes/show.yml'
@@ -82,13 +80,13 @@
/public/api/v1/inboxes/{inbox_identifier}/contacts:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_inbox_identifier'
post:
$ref: ./public/inboxes/contacts/create.yml
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
get:
$ref: './public/inboxes/contacts/show.yml'
patch:
@@ -96,8 +94,8 @@
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
post:
$ref: ./public/inboxes/conversations/create.yml
get:
@@ -105,61 +103,54 @@
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
get:
$ref: ./public/inboxes/conversations/show.yml
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_status:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./public/inboxes/conversations/toggle_status.yml
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_typing:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./public/inboxes/conversations/toggle_typing.yml
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/update_last_seen:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./public/inboxes/conversations/update_last_seen.yml
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./public/inboxes/messages/create.yml
get:
$ref: ./public/inboxes/messages/index.yml
+
/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}:
parameters:
- - $ref: '#/parameters/public_inbox_identifier'
- - $ref: '#/parameters/public_contact_identifier'
- - $ref: '#/parameters/conversation_id'
- - $ref: '#/parameters/message_id'
+ - $ref: '#/components/parameters/public_inbox_identifier'
+ - $ref: '#/components/parameters/public_contact_identifier'
+ - $ref: '#/components/parameters/conversation_id'
+ - $ref: '#/components/parameters/message_id'
patch:
$ref: ./public/inboxes/messages/update.yml
-/api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels:
- parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/public_contact_identifier'
- get:
- $ref: ./application/contacts/labels/index.yml
- post:
- $ref: ./application/contacts/labels/create.yml
# ---------------- end of public api routes-----------#
@@ -167,7 +158,7 @@
/survey/responses/{conversation_uuid}:
parameters:
- - $ref: '#/parameters/conversation_uuid'
+ - $ref: '#/components/parameters/conversation_uuid'
get:
$ref: ./survey/show.yml
@@ -175,19 +166,18 @@
# ------------ Application API routes ------------#
-
# AgentBots
/api/v1/accounts/{account_id}/agent_bots:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/agent_bots/index.yml
post:
$ref: ./application/agent_bots/create.yml
/api/v1/accounts/{account_id}/agent_bots/{id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/agent_bot_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/agent_bot_id'
get:
$ref: './application/agent_bots/show.yml'
patch:
@@ -198,14 +188,14 @@
# Agents
/api/v1/accounts/{account_id}/agents:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/agents/index.yml
post:
$ref: ./application/agents/create.yml
/api/v1/accounts/{account_id}/agents/{id}:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
patch:
$ref: ./application/agents/update.yml
delete:
@@ -214,14 +204,14 @@
# Canned Responses
/api/v1/accounts/{account_id}/canned_responses:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/canned_responses/index.yml
post:
$ref: ./application/canned_responses/create.yml
/api/v1/accounts/{account_id}/canned_responses/{id}:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
patch:
$ref: ./application/canned_responses/update.yml
delete:
@@ -230,17 +220,18 @@
# Custom Attributes
/api/v1/accounts/{account_id}/custom_attribute_definitions:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/custom_attributes/index.yml
post:
$ref: ./application/custom_attributes/create.yml
/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the custom attribute
required: true
get:
@@ -257,13 +248,12 @@
$ref: ./application/contacts/crud.yml
/api/v1/accounts/{account_id}/contacts/{id}/conversations:
$ref: ./application/contacts/conversations.yml
+/api/v1/accounts/{account_id}/contacts/{id}/labels:
+ $ref: ./application/contacts/labels.yml
/api/v1/accounts/{account_id}/contacts/search:
$ref: ./application/contacts/search.yml
/api/v1/accounts/{account_id}/contacts/filter:
- parameters:
- - $ref: '#/parameters/account_id'
- post:
- $ref: ./application/contacts/filter.yml
+ $ref: ./application/contacts/filter.yml
/api/v1/accounts/{account_id}/contacts/{id}/contact_inboxes:
$ref: ./application/contact_inboxes/create.yml
/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes:
@@ -273,17 +263,18 @@
# Automation Rule
/api/v1/accounts/{account_id}/automation_rules:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/automation_rule/index.yml
post:
$ref: ./application/automation_rule/create.yml
/api/v1/accounts/{account_id}/automation_rules/{id}:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- name: id
in: path
- type: number
+ schema:
+ type: number
description: ID of the Automation Rule
required: true
get:
@@ -293,36 +284,37 @@
delete:
$ref: ./application/automation_rule/delete.yml
-
# Help Center
/api/v1/accounts/{account_id}/portals:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
post:
$ref: ./application/portal/create.yml
get:
$ref: ./application/portal/index.yml
+/api/v1/accounts/{account_id}/portals/{id}:
+ parameters:
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/portal_id'
patch:
$ref: ./application/portal/update.yml
-
# Help Center category
-/api/v1/accounts/{account_id}/portals/{portal_id}/categories:
+/api/v1/accounts/{account_id}/portals/{id}/categories:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/portal_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/portal_id'
post:
$ref: ./application/category/create.yml
# Help Center article
-/api/v1/accounts/{account_id}/portals/{portal_id}/articles:
+/api/v1/accounts/{account_id}/portals/{id}/articles:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/portal_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/portal_id'
post:
$ref: ./application/article/create.yml
-
# Conversations
/api/v1/accounts/{account_id}/conversations/meta:
$ref: ./application/conversation/meta.yml
@@ -330,34 +322,34 @@
$ref: ./application/conversation/index.yml
/api/v1/accounts/{account_id}/conversations/filter:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
post:
$ref: ./application/conversation/filter.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
get:
$ref: ./application/conversation/show.yml
patch:
$ref: ./application/conversation/update.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./application/conversation/toggle_status.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_priority:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./application/conversation/toggle_priority.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./application/conversation/custom_attributes.yml
@@ -365,8 +357,8 @@
/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
post:
$ref: ./application/conversation/assignments.yml
@@ -374,14 +366,13 @@
/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
get:
$ref: ./application/conversation/labels/index.yml
post:
$ref: ./application/conversation/labels/create.yml
-
# Inboxes
/api/v1/accounts/{account_id}/inboxes:
$ref: ./application/inboxes/index.yml
@@ -399,14 +390,14 @@
# Inbox Members
/api/v1/accounts/{account_id}/inbox_members/{inbox_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/inbox_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/inbox_id'
get:
$ref: ./application/inboxes/inbox_members/show.yml
/api/v1/accounts/{account_id}/inbox_members:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
post:
$ref: ./application/inboxes/inbox_members/create.yml
patch:
@@ -414,31 +405,27 @@
delete:
$ref: ./application/inboxes/inbox_members/delete.yml
-
-
# Messages
/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
get:
$ref: ./application/conversation/messages/index.yml
post:
$ref: ./application/conversation/messages/create.yml
/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/conversation_id'
- - $ref: '#/parameters/message_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/conversation_id'
+ - $ref: '#/components/parameters/message_id'
delete:
$ref: ./application/conversation/messages/delete.yml
-
-
# Integrations
/api/v1/accounts/{account_id}/integrations/apps:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: './application/integrations/apps/show.yml'
/api/v1/accounts/{account_id}/integrations/hooks:
@@ -450,25 +437,22 @@
delete:
$ref: ./application/integrations/hooks/delete.yml
-
-
# Profile
/api/v1/profile:
$ref: ./profile/index.yml
-
# Teams
/api/v1/accounts/{account_id}/teams:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/teams/index.yml
post:
$ref: ./application/teams/create.yml
/api/v1/accounts/{account_id}/teams/{team_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/team_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/team_id'
get:
$ref: './application/teams/show.yml'
patch:
@@ -477,8 +461,8 @@
$ref: ./application/teams/delete.yml
/api/v1/accounts/{account_id}/teams/{team_id}/team_members:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/team_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/team_id'
get:
$ref: ./application/team_members/index.yml
post:
@@ -493,11 +477,12 @@
# Custom Filters
/api/v1/accounts/{account_id}/custom_filters:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- in: query
name: filter_type
- type: string
- enum: ['conversation', 'contact', 'report']
+ schema:
+ type: string
+ enum: ['conversation', 'contact', 'report']
required: false
description: The type of custom filter
get:
@@ -506,8 +491,8 @@
$ref: ./application/custom_filters/create.yml
/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/custom_filter_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/custom_filter_id'
get:
$ref: './application/custom_filters/show.yml'
patch:
@@ -518,15 +503,15 @@
# webhooks
/api/v1/accounts/{account_id}/webhooks:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
get:
$ref: ./application/webhooks/index.yml
post:
$ref: ./application/webhooks/create.yml
/api/v1/accounts/{account_id}/webhooks/{webhook_id}:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/webhook_id'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/webhook_id'
patch:
$ref: ./application/webhooks/update.yml
delete:
@@ -537,20 +522,23 @@
# List
/api/v2/accounts/{account_id}/reports:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/report_metric'
- - $ref: '#/parameters/report_type'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/report_metric'
+ - $ref: '#/components/parameters/report_type'
- in: query
name: id
- type: string
+ schema:
+ type: string
description: The Id of specific object in case of agent/inbox/label
- in: query
name: since
- type: string
+ schema:
+ type: string
description: The timestamp from where report should start.
- in: query
name: until
- type: string
+ schema:
+ type: string
description: The timestamp from where report should stop.
get:
$ref: './application/reports/index.yml'
@@ -558,19 +546,22 @@
# Summary
/api/v2/accounts/{account_id}/reports/summary:
parameters:
- - $ref: '#/parameters/account_id'
- - $ref: '#/parameters/report_type'
+ - $ref: '#/components/parameters/account_id'
+ - $ref: '#/components/parameters/report_type'
- in: query
name: id
- type: string
+ schema:
+ type: string
description: The Id of specific object in case of agent/inbox/label
- in: query
name: since
- type: string
+ schema:
+ type: string
description: The timestamp from where report should start.
- in: query
name: until
- type: string
+ schema:
+ type: string
description: The timestamp from where report should stop.
get:
$ref: './application/reports/summary.yml'
@@ -578,12 +569,13 @@
# Conversation metrics for account
/api/v2/accounts/{account_id}/reports/conversations:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- in: query
name: type
- type: string
- enum:
- - account
+ schema:
+ type: string
+ enum:
+ - account
required: true
description: Type of report
get:
@@ -592,17 +584,43 @@
# Conversation metrics for agent
/api/v2/accounts/{account_id}/reports/conversations/:
parameters:
- - $ref: '#/parameters/account_id'
+ - $ref: '#/components/parameters/account_id'
- in: query
name: type
- type: string
- enum:
- - agent
+ schema:
+ type: string
+ enum:
+ - agent
required: true
description: Type of report
- in: query
name: user_id
- type: string
+ schema:
+ type: string
description: The numeric ID of the user
get:
$ref: './application/reports/conversation/agent.yml'
+
+# Conversations Messages
+/accounts/{account_id}/conversations/{conversation_id}/messages:
+ parameters:
+ - $ref: '#/components/parameters/account_id'
+ - name: conversation_id
+ in: path
+ description: ID of the conversation
+ required: true
+ schema:
+ type: number
+ get:
+ tags:
+ - Conversation
+ summary: Get messages from a conversation
+ description: Returns all messages from a specific conversation
+ operationId: getConversationMessages
+ responses:
+ '200':
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/conversation_messages'
diff --git a/swagger/paths/platform/account_users/create.yml b/swagger/paths/platform/account_users/create.yml
index 97dc7127d..69d7c4b98 100644
--- a/swagger/paths/platform/account_users/create.yml
+++ b/swagger/paths/platform/account_users/create.yml
@@ -5,37 +5,33 @@ summary: Create an Account User
description: Create an Account User
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - user_id
- - role
- properties:
- user_id:
- type: integer
- description: The ID of the user
- role:
- type: string
- description: whether user is an administrator or agent
-
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/account_user_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- properties:
- account_id:
- type: integer
- description: The ID of the user
- user_id:
- type: integer
- description: The ID of the user
- role:
- type: string
- description: whether user is an administrator or agent
-
- 401:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ account_id:
+ type: integer
+ description: The ID of the account
+ user_id:
+ type: integer
+ description: The ID of the user
+ role:
+ type: string
+ description: whether user is an administrator or agent
+
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/account_users/delete.yml b/swagger/paths/platform/account_users/delete.yml
index d864619f7..f2fc35535 100644
--- a/swagger/paths/platform/account_users/delete.yml
+++ b/swagger/paths/platform/account_users/delete.yml
@@ -5,23 +5,18 @@ summary: Delete an Account User
description: Delete an Account User
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- type: object
- required:
- - user_id
- properties:
- user_id:
- type: integer
- description: The ID of the user
-
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The account does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/account_users/index.yml b/swagger/paths/platform/account_users/index.yml
index bcaed1807..dfcdded99 100644
--- a/swagger/paths/platform/account_users/index.yml
+++ b/swagger/paths/platform/account_users/index.yml
@@ -6,23 +6,15 @@ description: List all account users
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of account users'
- items:
- type: object
- properties:
- account_id:
- type: integer
- description: The ID of the user
- user_id:
- type: integer
- description: The ID of the user
- role:
- type: string
- description: whether user is an administrator or agent
-
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/account_user'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/accounts/create.yml b/swagger/paths/platform/accounts/create.yml
index a6e9841b9..a8ea455f5 100644
--- a/swagger/paths/platform/accounts/create.yml
+++ b/swagger/paths/platform/accounts/create.yml
@@ -5,16 +5,22 @@ summary: Create an Account
description: Create an Account
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/account_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/account_create_update_payload'
responses:
200:
description: Success
- schema:
- $ref: '#/definitions/platform_account'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/platform_account'
401:
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/accounts/delete.yml b/swagger/paths/platform/accounts/delete.yml
index 755b76d1e..d7e25795b 100644
--- a/swagger/paths/platform/accounts/delete.yml
+++ b/swagger/paths/platform/accounts/delete.yml
@@ -6,9 +6,17 @@ description: Delete an Account
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The account does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/accounts/show.yml b/swagger/paths/platform/accounts/show.yml
index d8ec94fe6..1df201701 100644
--- a/swagger/paths/platform/accounts/show.yml
+++ b/swagger/paths/platform/accounts/show.yml
@@ -6,11 +6,21 @@ description: Get the details of an account
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/platform_account'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/platform_account'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given account does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/accounts/update.yml b/swagger/paths/platform/accounts/update.yml
index a70ce9468..a30caea1f 100644
--- a/swagger/paths/platform/accounts/update.yml
+++ b/swagger/paths/platform/accounts/update.yml
@@ -5,16 +5,22 @@ summary: Update an account
description: Update an account's attributes
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/account_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/account_create_update_payload'
responses:
200:
description: Success
- schema:
- $ref: '#/definitions/platform_account'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/platform_account'
401:
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/agent_bots/create.yml b/swagger/paths/platform/agent_bots/create.yml
index a862ca131..4f916d672 100644
--- a/swagger/paths/platform/agent_bots/create.yml
+++ b/swagger/paths/platform/agent_bots/create.yml
@@ -5,16 +5,22 @@ summary: Create an Agent Bot
description: Create an agent bot
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/agent_bot_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/platform_agent_bot_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/agent_bots/delete.yml b/swagger/paths/platform/agent_bots/delete.yml
index 676c8f525..a89fed307 100644
--- a/swagger/paths/platform/agent_bots/delete.yml
+++ b/swagger/paths/platform/agent_bots/delete.yml
@@ -6,9 +6,17 @@ description: Delete an AgentBot
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The agent bot does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/agent_bots/index.yml b/swagger/paths/platform/agent_bots/index.yml
index 7ef3ee9c9..054085471 100644
--- a/swagger/paths/platform/agent_bots/index.yml
+++ b/swagger/paths/platform/agent_bots/index.yml
@@ -6,12 +6,18 @@ description: List all agent bots available
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of agent bots'
- items:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of agent bots'
+ items:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/agent_bots/show.yml b/swagger/paths/platform/agent_bots/show.yml
index dfbd43a27..d0a8ba37c 100644
--- a/swagger/paths/platform/agent_bots/show.yml
+++ b/swagger/paths/platform/agent_bots/show.yml
@@ -6,11 +6,21 @@ description: Get the details of an agent bot
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given agent bot ID does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/agent_bots/update.yml b/swagger/paths/platform/agent_bots/update.yml
index 842b4854d..7abc46ab8 100644
--- a/swagger/paths/platform/agent_bots/update.yml
+++ b/swagger/paths/platform/agent_bots/update.yml
@@ -5,16 +5,22 @@ summary: Update an agent bot
description: Update an agent bot's attributes
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/agent_bot_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/platform_agent_bot_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/agent_bot'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/agent_bot'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/users/create.yml b/swagger/paths/platform/users/create.yml
index 7433b8dc6..3d2bdb412 100644
--- a/swagger/paths/platform/users/create.yml
+++ b/swagger/paths/platform/users/create.yml
@@ -5,16 +5,22 @@ summary: Create a User
description: Create a User
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/user_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/user'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/users/delete.yml b/swagger/paths/platform/users/delete.yml
index a7658c215..d26e9d285 100644
--- a/swagger/paths/platform/users/delete.yml
+++ b/swagger/paths/platform/users/delete.yml
@@ -6,9 +6,17 @@ description: Delete a User
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The user does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/users/login.yml b/swagger/paths/platform/users/login.yml
index be210c7aa..9e327e745 100644
--- a/swagger/paths/platform/users/login.yml
+++ b/swagger/paths/platform/users/login.yml
@@ -6,15 +6,25 @@ description: Get the sso link of a user
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: object
- properties:
- url:
- type: string
- description: SSO url to autenticate the user
- 401:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ url:
+ type: string
+ description: SSO url to autenticate the user
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given user does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/users/show.yml b/swagger/paths/platform/users/show.yml
index bf937b49a..e42b3854e 100644
--- a/swagger/paths/platform/users/show.yml
+++ b/swagger/paths/platform/users/show.yml
@@ -6,11 +6,21 @@ description: Get the details of an user
security:
- platformAppApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/user'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given user does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/platform/users/token.yml b/swagger/paths/platform/users/token.yml
new file mode 100644
index 000000000..f4fedc311
--- /dev/null
+++ b/swagger/paths/platform/users/token.yml
@@ -0,0 +1,42 @@
+tags:
+ - Users
+operationId: post-user-token
+summary: Get User Access Token
+description: Get the access token of a user
+security:
+ - platformAppApiKey: []
+responses:
+ 200:
+ description: Success
+ schema:
+ type: object
+ properties:
+ access_token:
+ type: string
+ description: Access token of the user
+ expiry:
+ type: [integer, "null"]
+ description: Expiry timestamp
+ user:
+ type: object
+ properties:
+ id:
+ type: integer
+ description: User ID
+ name:
+ type: string
+ description: User's full name
+ display_name:
+ type: string
+ description: User's display name
+ email:
+ type: string
+ description: User's email address
+ pubsub_token:
+ type: string
+ description: User's pubsub token
+ 401:
+ description: Unauthorized
+ 404:
+ description: The given user does not exist
+
diff --git a/swagger/paths/platform/users/update.yml b/swagger/paths/platform/users/update.yml
index 56ea0026d..f340448da 100644
--- a/swagger/paths/platform/users/update.yml
+++ b/swagger/paths/platform/users/update.yml
@@ -5,16 +5,22 @@ summary: Update a user
description: Update a user's attributes
security:
- platformAppApiKey: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/user_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/user'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/profile/index.yml b/swagger/paths/profile/index.yml
index e20004cac..17eda92d0 100644
--- a/swagger/paths/profile/index.yml
+++ b/swagger/paths/profile/index.yml
@@ -4,10 +4,18 @@ get:
operationId: fetchProfile
summary: Fetch user profile
description: Get the user profile details
+ security:
+ - userApiKey: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/user'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/user'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/contacts/create.yml b/swagger/paths/public/inboxes/contacts/create.yml
index 51d894f3e..4e8d1f6eb 100644
--- a/swagger/paths/public/inboxes/contacts/create.yml
+++ b/swagger/paths/public/inboxes/contacts/create.yml
@@ -4,16 +4,22 @@ operationId: create-a-contact
summary: Create a contact
description: Create a contact
security: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/public_contact_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_contact_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_contact'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_contact'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/contacts/show.yml b/swagger/paths/public/inboxes/contacts/show.yml
index a5d8b8fdc..49039266a 100644
--- a/swagger/paths/public/inboxes/contacts/show.yml
+++ b/swagger/paths/public/inboxes/contacts/show.yml
@@ -5,11 +5,21 @@ summary: Get a contact
description: Get the details of a contact
security: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_contact'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_contact'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given contact does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/contacts/update.yml b/swagger/paths/public/inboxes/contacts/update.yml
index a413c76b3..8134d7bfd 100644
--- a/swagger/paths/public/inboxes/contacts/update.yml
+++ b/swagger/paths/public/inboxes/contacts/update.yml
@@ -4,16 +4,22 @@ operationId: update-a-contact
summary: Update a contact
description: Update a contact's attributes
security: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/public_contact_create_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_contact_create_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_contact'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_contact'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/create.yml b/swagger/paths/public/inboxes/conversations/create.yml
index 4c2a85d22..31bd9ac86 100644
--- a/swagger/paths/public/inboxes/conversations/create.yml
+++ b/swagger/paths/public/inboxes/conversations/create.yml
@@ -4,16 +4,22 @@ operationId: create-a-conversation
summary: Create a conversation
description: Create a conversation
security: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/public_conversation_create_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_conversation_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_conversation'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_conversation'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/index.yml b/swagger/paths/public/inboxes/conversations/index.yml
index bcd598758..3bfc89873 100644
--- a/swagger/paths/public/inboxes/conversations/index.yml
+++ b/swagger/paths/public/inboxes/conversations/index.yml
@@ -3,13 +3,20 @@ tags:
operationId: list-all-contact-conversations
summary: List all conversations
description: List all conversations for the contact
+security: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of conversations'
- items:
- $ref: '#/definitions/public_conversation'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of conversations'
+ items:
+ $ref: '#/components/schemas/public_conversation'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/show.yml b/swagger/paths/public/inboxes/conversations/show.yml
index 2ec6caa63..320457c48 100644
--- a/swagger/paths/public/inboxes/conversations/show.yml
+++ b/swagger/paths/public/inboxes/conversations/show.yml
@@ -3,12 +3,23 @@ tags:
operationId: get-single-conversation
summary: Get a single conversation
description: Retrieves the details of a specific conversation
+security: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_conversation'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_conversation'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/toggle_status.yml b/swagger/paths/public/inboxes/conversations/toggle_status.yml
index cac1c3d8d..bfbd41c70 100644
--- a/swagger/paths/public/inboxes/conversations/toggle_status.yml
+++ b/swagger/paths/public/inboxes/conversations/toggle_status.yml
@@ -3,12 +3,23 @@ tags:
operationId: resolve-conversation
summary: Resolve a conversation
description: Marks a conversation as resolved
+security: []
responses:
- 200:
+ '200':
description: Conversation resolved successfully
- schema:
- $ref: '#/definitions/public_conversation'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_conversation'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/toggle_typing.yml b/swagger/paths/public/inboxes/conversations/toggle_typing.yml
index af01c77f6..603ed0f8d 100644
--- a/swagger/paths/public/inboxes/conversations/toggle_typing.yml
+++ b/swagger/paths/public/inboxes/conversations/toggle_typing.yml
@@ -3,16 +3,38 @@ tags:
operationId: toggle-typing-status
summary: Toggle typing status
description: Toggles the typing status in a conversation
+security: []
parameters:
- name: typing_status
in: query
required: true
- type: string
+ schema:
+ type: string
description: Typing status, either 'on' or 'off'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ typing_status:
+ type: string
+ enum: ['on', 'off']
+ description: The typing status to set
+ example: 'on'
responses:
- 200:
+ '200':
description: Typing status toggled successfully
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/conversations/update_last_seen.yml b/swagger/paths/public/inboxes/conversations/update_last_seen.yml
index 4e56aa11d..a3e199e73 100644
--- a/swagger/paths/public/inboxes/conversations/update_last_seen.yml
+++ b/swagger/paths/public/inboxes/conversations/update_last_seen.yml
@@ -3,10 +3,19 @@ tags:
operationId: update-last-seen
summary: Update last seen
description: Updates the last seen time of the contact in a conversation
+security: []
responses:
- 200:
+ '200':
description: Last seen updated successfully
- 401:
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: Conversation not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/messages/create.yml b/swagger/paths/public/inboxes/messages/create.yml
index 902090952..1afa7d731 100644
--- a/swagger/paths/public/inboxes/messages/create.yml
+++ b/swagger/paths/public/inboxes/messages/create.yml
@@ -4,16 +4,22 @@ operationId: create-a-message
summary: Create a message
description: Create a message
security: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/public_message_create_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_message_create_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_message'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_message'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/messages/index.yml b/swagger/paths/public/inboxes/messages/index.yml
index 0c9eaeab3..68e34fed7 100644
--- a/swagger/paths/public/inboxes/messages/index.yml
+++ b/swagger/paths/public/inboxes/messages/index.yml
@@ -3,13 +3,20 @@ tags:
operationId: list-all-converation-messages
summary: List all messages
description: List all messages in the conversation
+security: []
responses:
- 200:
+ '200':
description: Success
- schema:
- type: array
- description: 'Array of messages'
- items:
- $ref: '#/definitions/public_message'
- 401:
+ content:
+ application/json:
+ schema:
+ type: array
+ description: 'Array of messages'
+ items:
+ $ref: '#/components/schemas/public_message'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/messages/update.yml b/swagger/paths/public/inboxes/messages/update.yml
index a211f39ca..38e41beed 100644
--- a/swagger/paths/public/inboxes/messages/update.yml
+++ b/swagger/paths/public/inboxes/messages/update.yml
@@ -4,16 +4,22 @@ operationId: update-a-message
summary: Update a message
description: Update a message
security: []
-parameters:
- - name: data
- in: body
- required: true
- schema:
- $ref: '#/definitions/public_message_update_payload'
+requestBody:
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_message_update_payload'
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_message'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_message'
+ '401':
description: Unauthorized
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/public/inboxes/show.yml b/swagger/paths/public/inboxes/show.yml
index 094caabbf..1effd078b 100644
--- a/swagger/paths/public/inboxes/show.yml
+++ b/swagger/paths/public/inboxes/show.yml
@@ -5,11 +5,21 @@ summary: Inbox details
description: Get the details of an inbox
security: []
responses:
- 200:
+ '200':
description: Success
- schema:
- $ref: '#/definitions/public_inbox'
- 401:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/public_inbox'
+ '401':
description: Unauthorized
- 404:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
+ '404':
description: The given inbox does not exist
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/bad_request_error'
diff --git a/swagger/paths/survey/show.yml b/swagger/paths/survey/show.yml
index c2bd1e8e8..ed9c71785 100644
--- a/swagger/paths/survey/show.yml
+++ b/swagger/paths/survey/show.yml
@@ -5,5 +5,5 @@ summary: Get CSAT survey page
description: You can redirect the client to this URL, instead of implementing the CSAT survey component yourself.
security: []
responses:
- 200:
+ '200':
description: Success
diff --git a/swagger/swagger.json b/swagger/swagger.json
index 19ef5c904..943b7a3e8 100644
--- a/swagger/swagger.json
+++ b/swagger/swagger.json
@@ -1,9 +1,9 @@
{
- "swagger": "2.0",
+ "openapi": "3.0.4",
"info": {
- "description": "This is the API documentation for Chatwoot server.",
- "version": "1.0.0",
"title": "Chatwoot",
+ "description": "This is the API documentation for Chatwoot server.",
+ "version": "1.1.0",
"termsOfService": "https://www.chatwoot.com/terms-of-service/",
"contact": {
"email": "hello@chatwoot.com"
@@ -13,42 +13,9 @@
"url": "https://opensource.org/licenses/MIT"
}
},
- "host": "app.chatwoot.com",
- "basePath": "/",
- "schemes": [
- "https"
- ],
- "produces": [
- "application/json; charset=utf-8"
- ],
- "consumes": [
- "application/json; charset=utf-8"
- ],
- "securityDefinitions": {
- "userApiKey": {
- "type": "apiKey",
- "in": "header",
- "name": "api_access_token",
- "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
- },
- "agentBotApiKey": {
- "type": "apiKey",
- "in": "header",
- "name": "api_access_token",
- "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
- },
- "platformAppApiKey": {
- "type": "apiKey",
- "in": "header",
- "name": "api_access_token",
- "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
- }
- },
- "security": [
+ "servers": [
{
- "userApiKey": [
-
- ]
+ "url": "https://app.chatwoot.com/"
}
],
"paths": {
@@ -62,30 +29,39 @@
"description": "Create an Account",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/account_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/platform_account"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -93,7 +69,7 @@
"/platform/api/v1/accounts/{account_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -105,23 +81,39 @@
"description": "Get the details of an account",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/platform_account"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given account does not exist"
+ "description": "The given account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -134,30 +126,39 @@
"description": "Update an account's attributes",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/account_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/platform_account"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -170,9 +171,7 @@
"description": "Delete an Account",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
@@ -180,10 +179,24 @@
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The account does not exist"
+ "description": "The account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -191,7 +204,7 @@
"/platform/api/v1/accounts/{account_id}/account_users": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -203,38 +216,29 @@
"description": "List all account users",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of account users",
- "items": {
- "type": "object",
- "properties": {
- "account_id": {
- "type": "integer",
- "description": "The ID of the user"
- },
- "user_id": {
- "type": "integer",
- "description": "The ID of the user"
- },
- "role": {
- "type": "string",
- "description": "whether user is an administrator or agent"
- }
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_user"
}
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -247,57 +251,53 @@
"description": "Create an Account User",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "user_id",
- "role"
- ],
- "properties": {
- "user_id": {
- "type": "integer",
- "description": "The ID of the user"
- },
- "role": {
- "type": "string",
- "description": "whether user is an administrator or agent"
- }
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_user_create_update_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "properties": {
- "account_id": {
- "type": "integer",
- "description": "The ID of the user"
- },
- "user_id": {
- "type": "integer",
- "description": "The ID of the user"
- },
- "role": {
- "type": "string",
- "description": "whether user is an administrator or agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
}
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -310,28 +310,7 @@
"description": "Delete an Account User",
"security": [
{
- "platformAppApiKey": [
-
- ]
- }
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "user_id"
- ],
- "properties": {
- "user_id": {
- "type": "integer",
- "description": "The ID of the user"
- }
- }
- }
+ "platformAppApiKey": []
}
],
"responses": {
@@ -339,10 +318,24 @@
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The account does not exist"
+ "description": "The account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -357,24 +350,33 @@
"description": "List all agent bots available",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of agent bots",
- "items": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent bots",
+ "items": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -387,30 +389,39 @@
"description": "Create an agent bot",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/agent_bot_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_agent_bot_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -418,7 +429,7 @@
"/platform/api/v1/agent_bots/{id}": {
"parameters": [
{
- "$ref": "#/parameters/agent_bot_id"
+ "$ref": "#/components/parameters/agent_bot_id"
}
],
"get": {
@@ -430,23 +441,39 @@
"description": "Get the details of an agent bot",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given agent bot ID does not exist"
+ "description": "The given agent bot ID does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -459,30 +486,39 @@
"description": "Update an agent bot's attributes",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/agent_bot_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_agent_bot_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -495,9 +531,7 @@
"description": "Delete an AgentBot",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
@@ -505,10 +539,24 @@
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The agent bot does not exist"
+ "description": "The agent bot does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -523,30 +571,39 @@
"description": "Create a User",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/user_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -554,7 +611,7 @@
"/platform/api/v1/users/{id}": {
"parameters": [
{
- "$ref": "#/parameters/platform_user_id"
+ "$ref": "#/components/parameters/platform_user_id"
}
],
"get": {
@@ -566,23 +623,39 @@
"description": "Get the details of an user",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given user does not exist"
+ "description": "The given user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -595,30 +668,39 @@
"description": "Update a user's attributes",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/user_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -631,9 +713,7 @@
"description": "Delete a User",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
@@ -641,10 +721,24 @@
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The user does not exist"
+ "description": "The user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -652,7 +746,7 @@
"/platform/api/v1/users/{id}/login": {
"parameters": [
{
- "$ref": "#/parameters/platform_user_id"
+ "$ref": "#/components/parameters/platform_user_id"
}
],
"get": {
@@ -664,29 +758,45 @@
"description": "Get the sso link of a user",
"security": [
{
- "platformAppApiKey": [
-
- ]
+ "platformAppApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "SSO url to autenticate the user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "SSO url to autenticate the user"
+ }
+ }
}
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given user does not exist"
+ "description": "The given user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -694,7 +804,7 @@
"/public/api/v1/inboxes/{inbox_identifier}": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
}
],
"get": {
@@ -704,21 +814,37 @@
"operationId": "get-details-of-a-inbox",
"summary": "Inbox details",
"description": "Get the details of an inbox",
- "security": [
-
- ],
+ "security": [],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_inbox"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_inbox"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given inbox does not exist"
+ "description": "The given inbox does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -726,7 +852,7 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
}
],
"post": {
@@ -736,28 +862,37 @@
"operationId": "create-a-contact",
"summary": "Create a contact",
"description": "Create a contact",
- "security": [
-
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/public_contact_create_update_payload"
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_contact"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -765,10 +900,10 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
}
],
"get": {
@@ -778,21 +913,37 @@
"operationId": "get-details-of-a-contact",
"summary": "Get a contact",
"description": "Get the details of a contact",
- "security": [
-
- ],
+ "security": [],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_contact"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given contact does not exist"
+ "description": "The given contact does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -803,28 +954,37 @@
"operationId": "update-a-contact",
"summary": "Update a contact",
"description": "Update a contact's attributes",
- "security": [
-
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/public_contact_create_update_payload"
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_contact"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -832,10 +992,10 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
}
],
"post": {
@@ -845,28 +1005,37 @@
"operationId": "create-a-conversation",
"summary": "Create a conversation",
"description": "Create a conversation",
- "security": [
-
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/public_conversation_create_payload"
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation_create_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_conversation"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -877,19 +1046,31 @@
"operationId": "list-all-contact-conversations",
"summary": "List all conversations",
"description": "List all conversations for the contact",
+ "security": [],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of conversations",
- "items": {
- "$ref": "#/definitions/public_conversation"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of conversations",
+ "items": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -897,13 +1078,13 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"get": {
@@ -913,18 +1094,37 @@
"operationId": "get-single-conversation",
"summary": "Get a single conversation",
"description": "Retrieves the details of a specific conversation",
+ "security": [],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_conversation"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -932,13 +1132,13 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_status": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -948,18 +1148,37 @@
"operationId": "resolve-conversation",
"summary": "Resolve a conversation",
"description": "Marks a conversation as resolved",
+ "security": [],
"responses": {
"200": {
"description": "Conversation resolved successfully",
- "schema": {
- "$ref": "#/definitions/public_conversation"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -967,13 +1186,13 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_typing": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -983,24 +1202,62 @@
"operationId": "toggle-typing-status",
"summary": "Toggle typing status",
"description": "Toggles the typing status in a conversation",
+ "security": [],
"parameters": [
{
"name": "typing_status",
"in": "query",
"required": true,
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "Typing status, either 'on' or 'off'"
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "typing_status": {
+ "type": "string",
+ "enum": [
+ "on",
+ "off"
+ ],
+ "description": "The typing status to set",
+ "example": "on"
+ }
+ }
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Typing status toggled successfully"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1008,13 +1265,13 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/update_last_seen": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -1024,15 +1281,30 @@
"operationId": "update-last-seen",
"summary": "Update last seen",
"description": "Updates the last seen time of the contact in a conversation",
+ "security": [],
"responses": {
"200": {
"description": "Last seen updated successfully"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1040,13 +1312,13 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -1056,28 +1328,37 @@
"operationId": "create-a-message",
"summary": "Create a message",
"description": "Create a message",
- "security": [
-
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/public_message_create_payload"
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message_create_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/public_message"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1088,19 +1369,31 @@
"operationId": "list-all-converation-messages",
"summary": "List all messages",
"description": "List all messages in the conversation",
+ "security": [],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of messages",
- "items": {
- "$ref": "#/definitions/public_message"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of messages",
+ "items": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1108,16 +1401,16 @@
"/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}": {
"parameters": [
{
- "$ref": "#/parameters/public_inbox_identifier"
+ "$ref": "#/components/parameters/public_inbox_identifier"
},
{
- "$ref": "#/parameters/public_contact_identifier"
+ "$ref": "#/components/parameters/public_contact_identifier"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
},
{
- "$ref": "#/parameters/message_id"
+ "$ref": "#/components/parameters/message_id"
}
],
"patch": {
@@ -1127,101 +1420,37 @@
"operationId": "update-a-message",
"summary": "Update a message",
"description": "Update a message",
- "security": [
-
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/public_message_update_payload"
- }
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "schema": {
- "$ref": "#/definitions/public_message"
- }
- },
- "401": {
- "description": "Unauthorized"
- }
- }
- }
- },
- "/api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels": {
- "parameters": [
- {
- "$ref": "#/parameters/account_id"
- },
- {
- "$ref": "#/parameters/public_contact_identifier"
- }
- ],
- "get": {
- "tags": [
- "Contact Labels"
- ],
- "operationId": "list-all-labels-of-a-contact",
- "summary": "List Labels",
- "description": "Lists all the labels of a contact",
- "responses": {
- "200": {
- "description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_labels"
- }
- },
- "404": {
- "description": "Contact not found"
- },
- "401": {
- "description": "Unauthorized"
- }
- }
- },
- "post": {
- "tags": [
- "Contact Labels"
- ],
- "operationId": "contact-add-labels",
- "summary": "Add Labels",
- "description": "Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.",
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "labels": {
- "type": "array",
- "description": "Array of labels (comma-separated strings)",
- "items": {
- "type": "string"
- }
- }
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message_update_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_labels"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
}
},
- "404": {
- "description": "Contact not found"
- },
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1229,7 +1458,7 @@
"/survey/responses/{conversation_uuid}": {
"parameters": [
{
- "$ref": "#/parameters/conversation_uuid"
+ "$ref": "#/components/parameters/conversation_uuid"
}
],
"get": {
@@ -1239,9 +1468,7 @@
"operationId": "get-csat-survey-page",
"summary": "Get CSAT survey page",
"description": "You can redirect the client to this URL, instead of implementing the CSAT survey component yourself.",
- "security": [
-
- ],
+ "security": [],
"responses": {
"200": {
"description": "Success"
@@ -1252,7 +1479,7 @@
"/api/v1/accounts/{account_id}/agent_bots": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -1262,19 +1489,35 @@
"operationId": "list-all-account-agent-bots",
"summary": "List all AgentBots",
"description": "List all agent bots available for the current account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of agent bots",
- "items": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent bots",
+ "items": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1285,28 +1528,41 @@
"operationId": "create-an-account-agent-bot",
"summary": "Create an Agent Bot",
"description": "Create an agent bot in the account",
- "parameters": [
+ "security": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/agent_bot_create_update_payload"
- }
+ "userApiKey": []
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1314,10 +1570,10 @@
"/api/v1/accounts/{account_id}/agent_bots/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/agent_bot_id"
+ "$ref": "#/components/parameters/agent_bot_id"
}
],
"get": {
@@ -1327,18 +1583,41 @@
"operationId": "get-details-of-a-single-account-agent-bot",
"summary": "Get an agent bot details",
"description": "Get the details of an agent bot in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given agent bot ID does not exist in the account"
+ "description": "The given agent bot ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1349,25 +1628,41 @@
"operationId": "update-an-account-agent-bot",
"summary": "Update an agent bot",
"description": "Update an agent bot's attributes",
- "parameters": [
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/agent_bot_create_update_payload"
- }
+ "userApiKey": []
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1378,15 +1673,34 @@
"operationId": "delete-an-account-agent-bot",
"summary": "Delete an AgentBot",
"description": "Delete an AgentBot from the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The agent bot does not exist in the account"
+ "description": "The agent bot does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1394,7 +1708,7 @@
"/api/v1/accounts/{account_id}/agents": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -1406,24 +1720,33 @@
"description": "Get Details of Agents in an Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1436,66 +1759,39 @@
"description": "Add a new Agent to Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "name",
- "email",
- "role"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "Full Name of the agent"
- },
- "email": {
- "type": "string",
- "description": "Email of the Agent"
- },
- "role": {
- "type": "string",
- "enum": [
- "agent",
- "administrator"
- ],
- "description": "Whether its administrator or agent"
- },
- "availability_status": {
- "type": "string",
- "enum": [
- "available",
- "busy",
- "offline"
- ],
- "description": "The availability setting of the agent."
- },
- "auto_offline": {
- "type": "boolean",
- "description": "Whether the availability status of agent is configured to go offline automatically when away."
- }
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_create_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1503,7 +1799,7 @@
"/api/v1/accounts/{account_id}/agents/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"patch": {
@@ -1515,66 +1811,60 @@
"description": "Update an Agent in Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the agent to be updated."
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "role"
- ],
- "properties": {
- "role": {
- "type": "string",
- "enum": [
- "agent",
- "administrator"
- ],
- "description": "Whether its administrator or agent"
- },
- "availability": {
- "type": "string",
- "enum": [
- "available",
- "busy",
- "offline"
- ],
- "description": "The availability setting of the agent."
- },
- "auto_offline": {
- "type": "boolean",
- "description": "Whether the availability status of agent is configured to go offline automatically when away."
- }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_update_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
},
"404": {
- "description": "Agent not found"
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1587,18 +1877,18 @@
"description": "Remove an Agent from Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
- "description": "The ID of the agent to be deleted"
+ "description": "The ID of the agent to be deleted."
}
],
"responses": {
@@ -1606,10 +1896,24 @@
"description": "Success"
},
"404": {
- "description": "Agent not found"
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1617,7 +1921,7 @@
"/api/v1/accounts/{account_id}/canned_responses": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -1629,24 +1933,33 @@
"description": "Get Details of Canned Responses in an Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all canned responses",
- "items": {
- "$ref": "#/definitions/canned_response"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all canned responses",
+ "items": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
}
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1659,30 +1972,39 @@
"description": "Add a new Canned Response to Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/canned_response_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/canned_response"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1690,52 +2012,72 @@
"/api/v1/accounts/{account_id}/canned_responses/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"patch": {
"tags": [
- "Canned Response"
+ "Canned Responses"
],
"operationId": "update-canned-response-in-account",
"summary": "Update Canned Response in Account",
"description": "Update a Canned Response in Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the canned response to be updated."
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/canned_response_create_update_payload"
- }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/canned_response"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
}
},
"404": {
- "description": "Agent not found"
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1748,16 +2090,16 @@
"description": "Remove a Canned Response from Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the canned response to be deleted"
}
@@ -1767,10 +2109,24 @@
"description": "Success"
},
"404": {
- "description": "Canned Response not found"
+ "description": "Canned Response not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1778,7 +2134,7 @@
"/api/v1/accounts/{account_id}/custom_attribute_definitions": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -1791,11 +2147,13 @@
{
"name": "attribute_model",
"in": "query",
- "type": "string",
- "enum": [
- "0",
- "1"
- ],
+ "schema": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
"description": "conversation_attribute(0)/contact_attribute(1)",
"required": true
}
@@ -1803,24 +2161,33 @@
"description": "Get details of custom attributes in an Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all custom attributes",
- "items": {
- "$ref": "#/definitions/custom_attribute"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all custom attributes",
+ "items": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
}
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1833,30 +2200,39 @@
"description": "Add a new custom attribute to account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/custom_attribute_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_attribute"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1864,12 +2240,14 @@
"/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the custom attribute",
"required": true
}
@@ -1880,15 +2258,22 @@
],
"operationId": "get-details-of-a-single-custom-attribute",
"summary": "Get a custom attribute details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get the details of a custom attribute in the account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the custom attribute to be updated."
}
@@ -1896,15 +2281,33 @@
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_attribute"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given attribute ID does not exist in the account"
+ "description": "The given attribute ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1917,40 +2320,60 @@
"description": "Update a custom attribute in account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the custom attribute to be updated."
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/custom_attribute_create_update_payload"
- }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_attribute"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
}
},
"404": {
- "description": "Agent not found"
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -1963,19 +2386,19 @@
"description": "Remove a custom attribute from account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the custom attribute to be deleted"
}
@@ -1985,10 +2408,24 @@
"description": "Success"
},
"404": {
- "description": "Custom attribute not found"
+ "description": "Custom attribute not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -1999,30 +2436,43 @@
"Contacts"
],
"operationId": "contactList",
- "description": "Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number",
+ "description": "Listing all the resolved contacts with pagination (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number",
"summary": "List Contacts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/contact_sort_param"
+ "$ref": "#/components/parameters/contact_sort_param"
},
{
- "$ref": "#/parameters/page"
+ "$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_list"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
+ }
+ }
}
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -2034,30 +2484,45 @@
"operationId": "contactCreate",
"description": "Create a new Contact",
"summary": "Create Contact",
- "parameters": [
+ "security": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/contact_create"
- }
+ "userApiKey": []
}
],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_create_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/extended_contact"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/extended_contact"
+ }
+ }
}
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -2066,14 +2531,16 @@
"/api/v1/accounts/{account_id}/contacts/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
- "description": "ID of the contact",
- "required": true
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
}
],
"get": {
@@ -2082,19 +2549,42 @@
],
"operationId": "contactDetails",
"summary": "Show Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get a contact belonging to the account using ID",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/extended_contact"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_show_response"
+ }
+ }
}
},
"404": {
- "description": "Contact not found"
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2104,29 +2594,52 @@
],
"operationId": "contactUpdate",
"summary": "Update Contact",
- "description": "Update a contact belonging to the account using ID",
- "parameters": [
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/contact_update"
- }
+ "userApiKey": []
}
],
+ "description": "Update a contact belonging to the account using ID",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"204": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_base"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_base"
+ }
+ }
}
},
"404": {
- "description": "Contact not found"
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2136,51 +2649,239 @@
],
"operationId": "contactDelete",
"summary": "Delete Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a contact belonging to the account using ID",
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Contact not found"
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
},
"/api/v1/accounts/{account_id}/contacts/{id}/conversations": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
"get": {
"tags": [
"Contacts"
],
"operationId": "contactConversations",
"summary": "Contact Conversations",
- "description": "Get conversations associated to that contact",
+ "description": "Get conversations associated with that contact",
"parameters": [
- {
- "$ref": "#/parameters/account_id"
- },
{
"name": "id",
"in": "path",
- "type": "number",
- "description": "ID of the contact",
- "required": true
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "security": [
+ {
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_conversations"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_conversations_response"
+ }
+ }
}
},
"404": {
- "description": "Contact not found"
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/{id}/labels": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Contact Labels"
+ ],
+ "operationId": "list-all-labels-of-a-contact",
+ "summary": "List Labels",
+ "description": "Lists all the labels of a contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_labels"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Contact Labels"
+ ],
+ "operationId": "contact-add-labels",
+ "summary": "Add Labels",
+ "description": "Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "labels"
+ ],
+ "properties": {
+ "labels": {
+ "type": "array",
+ "description": "Array of labels (comma-separated strings)",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "support",
+ "billing"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_labels"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2193,50 +2894,55 @@
"operationId": "contactSearch",
"description": "Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number",
"summary": "Search Contacts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "q",
"in": "query",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "Search using contact `name`, `identifier`, `email` or `phone number`"
},
{
- "$ref": "#/parameters/contact_sort_param"
+ "$ref": "#/components/parameters/contact_sort_param"
},
{
- "$ref": "#/parameters/page"
+ "$ref": "#/components/parameters/page"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "object",
- "properties": {
- "payload": {
- "$ref": "#/definitions/contact_list"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
}
}
}
},
"401": {
"description": "Authentication error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
}
},
"/api/v1/accounts/{account_id}/contacts/filter": {
- "parameters": [
- {
- "$ref": "#/parameters/account_id"
- }
- ],
"post": {
"tags": [
"Contacts"
@@ -2246,99 +2952,107 @@
"summary": "Contact Filter",
"security": [
{
- "userApiKey": [
-
- ]
- },
- {
- "agentBotApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
- "name": "page",
- "in": "query",
- "type": "integer"
+ "$ref": "#/components/parameters/account_id"
},
{
- "name": "body",
- "in": "body",
- "required": true,
+ "name": "page",
+ "in": "query",
"schema": {
- "type": "object",
- "properties": {
- "payload": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "attribute_key": {
- "type": "string",
- "description": "filter attribute name"
- },
- "filter_operator": {
- "type": "string",
- "description": "filter operator name",
- "enum": [
- "equal_to",
- "not_equal_to",
- "contains",
- "does_not_contain"
- ]
- },
- "values": {
- "type": "array",
- "items": {
- "type": "string"
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attribute_key": {
+ "type": "string",
+ "description": "filter attribute name"
},
- "description": "array of the attribute values to filter"
- },
- "query_operator": {
- "type": "string",
- "description": "query operator name",
- "enum": [
- "AND",
- "OR"
- ]
+ "filter_operator": {
+ "type": "string",
+ "description": "filter operator name",
+ "enum": [
+ "equal_to",
+ "not_equal_to",
+ "contains",
+ "does_not_contain"
+ ]
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "array of the attribute values to filter"
+ },
+ "query_operator": {
+ "type": "string",
+ "description": "query operator name",
+ "enum": [
+ "AND",
+ "OR"
+ ]
+ }
}
- }
- },
- "example": [
- {
- "attribute_key": "name",
- "filter_operator": "equal_to",
- "values": [
- "en"
- ],
- "query_operator": "AND"
},
- {
- "attribute_key": "country_code",
- "filter_operator": "equal_to",
- "values": [
- "us"
- ],
- "query_operator": null
- }
- ]
+ "example": [
+ {
+ "attribute_key": "name",
+ "filter_operator": "equal_to",
+ "values": [
+ "en"
+ ],
+ "query_operator": "AND"
+ },
+ {
+ "attribute_key": "country_code",
+ "filter_operator": "equal_to",
+ "values": [
+ "us"
+ ],
+ "query_operator": null
+ }
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_list"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
+ }
+ }
}
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -2354,52 +3068,77 @@
"summary": "Create contact inbox",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the contact",
"required": true
- },
+ }
+ ],
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "inbox_id"
- ],
- "properties": {
- "inbox_id": {
- "type": "number",
- "description": "The ID of the inbox"
- },
- "source_id": {
- "type": "string",
- "description": "Contact Inbox Source Id"
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox",
+ "example": 1
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contact_inboxes"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
}
},
"401": {
"description": "Authentication error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
},
"422": {
- "description": "Incorrect payload"
+ "description": "Incorrect payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2412,14 +3151,21 @@
"operationId": "contactableInboxesGet",
"description": "Get List of contactable Inboxes",
"summary": "Get Contactable Inboxes",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the contact",
"required": true
}
@@ -2427,18 +3173,33 @@
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/contactable_inboxes"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contactable_inboxes_response"
+ }
+ }
}
},
"401": {
"description": "Authentication error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
},
"422": {
- "description": "Incorrect payload"
+ "description": "Incorrect payload",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2446,7 +3207,7 @@
"/api/v1/accounts/{account_id}/automation_rules": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -2457,33 +3218,38 @@
"summary": "List all automation rules in an account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/page"
+ "$ref": "#/components/parameters/page"
}
],
"description": "Get details of automation rules in an Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all automation rules",
- "items": {
- "$ref": "#/definitions/automation_rule"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
}
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2496,30 +3262,39 @@
"description": "Add a new automation rule to account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/automation_rule_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/automation_rule"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2527,12 +3302,14 @@
"/api/v1/accounts/{account_id}/automation_rules/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the Automation Rule",
"required": true
}
@@ -2544,11 +3321,18 @@
"operationId": "get-details-of-a-single-automation-rule",
"summary": "Get a automation rule details",
"description": "Get the details of a automation rule in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the automation rule to be updated."
}
@@ -2556,15 +3340,70 @@
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/automation_rule"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ },
+ "example": {
+ "payload": {
+ "id": 90,
+ "account_id": 1,
+ "name": "add-label-bug-if-message-contains-bug",
+ "description": "add-label-bug-if-message-contains-bug",
+ "event_name": "message_created",
+ "conditions": [
+ {
+ "values": [
+ "incoming"
+ ],
+ "attribute_key": "message_type",
+ "query_operator": "and",
+ "filter_operator": "equal_to"
+ },
+ {
+ "values": [
+ "bug"
+ ],
+ "attribute_key": "content",
+ "filter_operator": "contains"
+ }
+ ],
+ "actions": [
+ {
+ "action_name": "add_label",
+ "action_params": [
+ "bugs",
+ "support-query"
+ ]
+ }
+ ],
+ "created_on": 1650555440,
+ "active": true
+ }
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given rule ID does not exist in the account"
+ "description": "The given rule ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2577,40 +3416,60 @@
"description": "Update a automation rule in account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the automation rule to be updated."
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/automation_rule_create_update_payload"
- }
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/automation_rule"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Rule not found"
+ "description": "Rule not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2623,16 +3482,16 @@
"description": "Remove a automation rule from account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"in": "path",
"name": "id",
- "type": "integer",
+ "schema": {
+ "type": "integer"
+ },
"required": true,
"description": "The ID of the automation rule to be deleted"
}
@@ -2642,10 +3501,24 @@
"description": "Success"
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "automation rule not found"
+ "description": "automation rule not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2653,7 +3526,7 @@
"/api/v1/accounts/{account_id}/portals": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"post": {
@@ -2665,30 +3538,39 @@
"description": "Add a new portal to account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/portal_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/portal"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -2700,77 +3582,227 @@
"summary": "List all portals in an account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"description": "Get details of portals in an Account",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all portals",
- "items": {
- "$ref": "#/definitions/portal"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal"
+ },
+ "example": {
+ "payload": [
+ {
+ "id": 4,
+ "color": "#1F93FF",
+ "custom_domain": "chatwoot.help",
+ "header_text": "Handbook",
+ "homepage_link": "https://www.chatwoot.com",
+ "name": "Handbook",
+ "page_title": "Handbook",
+ "slug": "handbook",
+ "archived": false,
+ "account_id": 1,
+ "config": {
+ "allowed_locales": [
+ {
+ "code": "en",
+ "articles_count": 32,
+ "categories_count": 9
+ }
+ ]
+ },
+ "inbox": {
+ "id": 37,
+ "avatar_url": "https://example.com/avatar.png",
+ "channel_id": 1,
+ "name": "Chatwoot",
+ "channel_type": "Channel::WebWidget",
+ "greeting_enabled": true,
+ "widget_color": "#1F93FF",
+ "website_url": "chatwoot.com"
+ },
+ "logo": {
+ "id": 19399916,
+ "portal_id": 4,
+ "file_type": "image/png",
+ "account_id": 1,
+ "file_url": "https://example.com/logo.png",
+ "blob_id": 21239614,
+ "filename": "square.png"
+ },
+ "meta": {
+ "all_articles_count": 0,
+ "categories_count": 9,
+ "default_locale": "en"
+ }
+ }
+ ]
+ }
}
}
},
"403": {
- "description": "Access denied"
- }
- }
- },
- "patch": {
- "tags": [
- "Help Center"
- ],
- "operationId": "update-new-portal-to-account",
- "summary": "update a new portal",
- "description": "update a new portal to account",
- "security": [
- {
- "userApiKey": [
-
- ]
- }
- ],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/portal_create_update_payload"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
- ],
- "responses": {
- "200": {
- "description": "Success",
- "schema": {
- "$ref": "#/definitions/portal"
- }
- },
- "403": {
- "description": "Access denied"
- }
}
}
},
- "/api/v1/accounts/{account_id}/portals/{portal_id}/categories": {
+ "/api/v1/accounts/{account_id}/portals/{id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/portal_id"
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "update-portal-to-account",
+ "summary": "Update a portal",
+ "description": "Update a portal to account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_single"
+ },
+ "example": {
+ "payload": {
+ "id": 123,
+ "archived": false,
+ "color": "#1F93FF",
+ "config": {
+ "allowed_locales": [
+ {
+ "code": "en",
+ "articles_count": 32,
+ "categories_count": 9
+ }
+ ]
+ },
+ "custom_domain": "chatwoot.help",
+ "header_text": "Handbook",
+ "homepage_link": "https://www.chatwoot.com",
+ "name": "Handbook",
+ "slug": "handbook",
+ "page_title": "Handbook",
+ "account_id": 123,
+ "inbox": {
+ "id": 123,
+ "name": "Chatwoot",
+ "website_url": "chatwoot.com",
+ "channel_type": "Channel::WebWidget",
+ "avatar_url": "https://example.com/avatar.png",
+ "widget_color": "#1F93FF",
+ "website_token": "4cWzuf9i9jxN9tbnv8K9STKU",
+ "enable_auto_assignment": true,
+ "web_widget_script": "",
+ "welcome_title": "Hi there ! 🙌🏼",
+ "welcome_tagline": "We make it simple to connect with us.",
+ "greeting_enabled": true,
+ "greeting_message": "Hey there 👋, Thank you for reaching out to us.",
+ "channel_id": 123,
+ "working_hours_enabled": true,
+ "enable_email_collect": true,
+ "csat_survey_enabled": true,
+ "timezone": "America/Los_Angeles",
+ "business_name": "Chatwoot",
+ "hmac_mandatory": true
+ },
+ "logo": {
+ "id": 123,
+ "portal_id": 123,
+ "file_type": "image/png",
+ "account_id": 123,
+ "file_url": "https://example.com/logo.png",
+ "blob_id": 123,
+ "filename": "square.png"
+ },
+ "meta": {
+ "all_articles_count": 32,
+ "categories_count": 9,
+ "default_locale": "en"
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Portal not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/portals/{id}/categories": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
}
],
"post": {
@@ -2782,41 +3814,50 @@
"description": "Add a new category to portal",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/category_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/category_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/category"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/category"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
},
- "/api/v1/accounts/{account_id}/portals/{portal_id}/articles": {
+ "/api/v1/accounts/{account_id}/portals/{id}/articles": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/portal_id"
+ "$ref": "#/components/parameters/portal_id"
}
],
"post": {
@@ -2828,30 +3869,39 @@
"description": "Add a new article to portal",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/article_create_update_payload"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/article_create_update_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/article"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/article"
+ }
+ }
}
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -2859,7 +3909,7 @@
"/api/v1/accounts/{account_id}/conversations/meta": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -2869,66 +3919,85 @@
"operationId": "conversationListMeta",
"description": "Get open, unassigned and all Conversation counts",
"summary": "Get Conversation Counts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
"name": "status",
"in": "query",
- "type": "string",
- "enum": [
- "all",
- "open",
- "resolved",
- "pending",
- "snoozed"
- ],
- "default": "open",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "all",
+ "open",
+ "resolved",
+ "pending",
+ "snoozed"
+ ],
+ "default": "open"
+ },
"description": "Filter by conversation status."
},
{
"name": "q",
"in": "query",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "Filters conversations with messages containing the search term"
},
{
"name": "inbox_id",
"in": "query",
- "type": "integer"
+ "schema": {
+ "type": "integer"
+ }
},
{
"name": "team_id",
"in": "query",
- "type": "integer"
+ "schema": {
+ "type": "integer"
+ }
},
{
"name": "labels",
"in": "query",
- "type": "array",
- "items": {
- "type": "string"
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "object",
- "properties": {
- "meta": {
+ "content": {
+ "application/json": {
+ "schema": {
"type": "object",
"properties": {
- "mine_count": {
- "type": "number"
- },
- "unassigned_count": {
- "type": "number"
- },
- "assigned_count": {
- "type": "number"
- },
- "all_count": {
- "type": "number"
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
}
}
}
@@ -2937,8 +4006,12 @@
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -2947,7 +4020,7 @@
"/api/v1/accounts/{account_id}/conversations": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -2957,77 +4030,104 @@
"operationId": "conversationList",
"description": "List all the conversations with pagination",
"summary": "Conversations List",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
"name": "assignee_type",
"in": "query",
- "type": "string",
- "enum": [
- "me",
- "unassigned",
- "all",
- "assigned"
- ],
- "default": "all",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "me",
+ "unassigned",
+ "all",
+ "assigned"
+ ],
+ "default": "all"
+ },
"description": "Filter conversations by assignee type."
},
{
"name": "status",
"in": "query",
- "type": "string",
- "enum": [
- "all",
- "open",
- "resolved",
- "pending",
- "snoozed"
- ],
- "default": "open",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "all",
+ "open",
+ "resolved",
+ "pending",
+ "snoozed"
+ ],
+ "default": "open"
+ },
"description": "Filter by conversation status."
},
{
"name": "q",
"in": "query",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "Filters conversations with messages containing the search term"
},
{
"name": "inbox_id",
"in": "query",
- "type": "integer"
+ "schema": {
+ "type": "integer"
+ }
},
{
"name": "team_id",
"in": "query",
- "type": "integer"
+ "schema": {
+ "type": "integer"
+ }
},
{
"name": "labels",
"in": "query",
- "type": "array",
- "items": {
- "type": "string"
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
}
},
{
"name": "page",
"in": "query",
- "type": "integer",
- "default": 1,
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
"description": "paginate through conversations"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_list"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_list"
+ }
+ }
}
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -3038,140 +4138,59 @@
],
"operationId": "newConversation",
"summary": "Create New Conversation",
- "description": "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://github.com/chatwoot/chatwoot/wiki/Building-on-Top-of-Chatwoot:-Importing-Existing-Contacts-and-Creating-Conversations",
+ "description": "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://www.chatwoot.com/hc/user-guide/articles/1677839703-how-to-create-an-api-channel-inbox#send-messages-to-the-api-channel",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "source_id",
- "inbox_id"
- ],
- "properties": {
- "source_id": {
- "type": "string",
- "description": "Conversation source id"
- },
- "inbox_id": {
- "type": "string",
- "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email "
- },
- "contact_id": {
- "type": "string",
- "description": "Contact Id for which conversation is created"
- },
- "additional_attributes": {
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
"type": "object",
- "description": "Lets you specify attributes like browser information"
- },
- "custom_attributes": {
- "type": "object",
- "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
- "example": {
- "attribute_key": "attribute_value",
- "priority_conversation_number": 3
- }
- },
- "status": {
- "type": "string",
- "enum": [
- "open",
- "resolved",
- "pending"
- ],
- "description": "Specify the conversation whether it's pending, open, closed"
- },
- "assignee_id": {
- "type": "string",
- "description": "Agent Id for assigning a conversation to an agent"
- },
- "team_id": {
- "type": "string",
- "description": "Team Id for assigning a conversation to a team"
- },
- "message": {
- "type": "object",
- "description": "The initial message to be sent to the conversation",
- "required": [
- "content"
- ],
"properties": {
- "content": {
- "type": "string",
- "description": "The content of the message"
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
},
- "template_params": {
- "type": "object",
- "description": "The template params for the message in case of whatsapp Channel",
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the template",
- "example": "sample_issue_resolution"
- },
- "category": {
- "type": "string",
- "description": "Category of the template",
- "example": "UTILITY"
- },
- "language": {
- "type": "string",
- "description": "Language of the template",
- "example": "en_US"
- },
- "processed_params": {
- "type": "object",
- "description": "The processed param values for template variables in template",
- "example": {
- "1": "Chatwoot"
- }
- }
- }
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
}
}
}
}
}
- }
- ],
- "responses": {
- "200": {
- "description": "Success",
- "schema": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID of the conversation"
- },
- "account_id": {
- "type": "number",
- "description": "Account Id"
- },
- "inbox_id": {
- "type": "number",
- "description": "ID of the inbox"
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
}
}
}
- },
- "403": {
- "description": "Access denied"
}
}
}
@@ -3179,7 +4198,7 @@
"/api/v1/accounts/{account_id}/conversations/filter": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"post": {
@@ -3191,99 +4210,104 @@
"summary": "Conversations Filter",
"security": [
{
- "userApiKey": [
-
- ]
- },
- {
- "agentBotApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
"name": "page",
"in": "query",
- "type": "integer"
- },
- {
- "name": "body",
- "in": "body",
- "required": true,
"schema": {
- "type": "object",
- "properties": {
- "payload": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "attribute_key": {
- "type": "string",
- "description": "filter attribute name"
- },
- "filter_operator": {
- "type": "string",
- "description": "filter operator name",
- "enum": [
- "equal_to",
- "not_equal_to",
- "contains",
- "does_not_contain"
- ]
- },
- "values": {
- "type": "array",
- "items": {
- "type": "string"
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attribute_key": {
+ "type": "string",
+ "description": "filter attribute name"
},
- "description": "array of the attribute values to filter"
- },
- "query_operator": {
- "type": "string",
- "description": "query operator name",
- "enum": [
- "AND",
- "OR"
- ]
+ "filter_operator": {
+ "type": "string",
+ "description": "filter operator name",
+ "enum": [
+ "equal_to",
+ "not_equal_to",
+ "contains",
+ "does_not_contain"
+ ]
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "array of the attribute values to filter"
+ },
+ "query_operator": {
+ "type": "string",
+ "description": "query operator name",
+ "enum": [
+ "AND",
+ "OR"
+ ]
+ }
}
- }
- },
- "example": [
- {
- "attribute_key": "browser_language",
- "filter_operator": "not_eq",
- "values": [
- "en"
- ],
- "query_operator": "AND"
},
- {
- "attribute_key": "status",
- "filter_operator": "eq",
- "values": [
- "pending"
- ],
- "query_operator": null
- }
- ]
+ "example": [
+ {
+ "attribute_key": "browser_language",
+ "filter_operator": "not_equal_to",
+ "values": [
+ "en"
+ ],
+ "query_operator": "AND"
+ },
+ {
+ "attribute_key": "status",
+ "filter_operator": "equal_to",
+ "values": [
+ "pending"
+ ],
+ "query_operator": null
+ }
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_list"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_list"
+ }
+ }
}
},
"400": {
"description": "Bad Request Error",
- "schema": {
- "$ref": "#/definitions/bad_request_error"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
}
}
@@ -3292,10 +4316,10 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"get": {
@@ -3304,19 +4328,42 @@
],
"operationId": "get-details-of-a-conversation",
"summary": "Conversation Details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get all details regarding a conversation with all messages in the conversation",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_show"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_show"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
},
"404": {
- "description": "Conversation not found"
- },
- "403": {
- "description": "Access denied"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -3329,52 +4376,64 @@
"description": "Update Conversation Attributes",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "priority": {
- "type": "string",
- "enum": [
- "urgent",
- "high",
- "medium",
- "low",
- "none"
- ],
- "description": "The priority of the conversation"
- },
- "sla_policy_id": {
- "type": "number",
- "description": "The ID of the SLA policy (Available only in Enterprise edition)"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "priority": {
+ "type": "string",
+ "enum": [
+ "urgent",
+ "high",
+ "medium",
+ "low",
+ "none"
+ ],
+ "description": "The priority of the conversation",
+ "example": "high"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy (Available only in Enterprise edition)",
+ "example": 1
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success"
},
- "404": {
- "description": "Conversation not found"
- },
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3382,10 +4441,10 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -3397,52 +4456,67 @@
"description": "Toggles the status of the conversation between open and resolved",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "status"
- ],
- "properties": {
- "status": {
- "type": "string",
- "enum": [
- "open",
- "resolved",
- "pending"
- ],
- "description": "The status of the conversation"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "status"
+ ],
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation",
+ "example": "open"
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_status_toggle"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_status_toggle"
+ }
+ }
}
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3450,10 +4524,10 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_priority": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -3465,51 +4539,62 @@
"description": "Toggles the priority of conversation",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "priority"
- ],
- "properties": {
- "priority": {
- "type": "string",
- "enum": [
- "urgent",
- "high",
- "medium",
- "low",
- "none"
- ],
- "description": "The priority of the conversation"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "priority"
+ ],
+ "properties": {
+ "priority": {
+ "type": "string",
+ "enum": [
+ "urgent",
+ "high",
+ "medium",
+ "low",
+ "none"
+ ],
+ "description": "The priority of the conversation",
+ "example": "high"
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success"
},
- "404": {
- "description": "Conversation not found"
- },
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3517,10 +4602,10 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
@@ -3532,57 +4617,68 @@
"description": "Updates the custom attributes of a conversation",
"security": [
{
- "userApiKey": [
-
- ]
- },
- {
- "agentBotApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "custom_attributes"
- ],
- "properties": {
- "custom_attributes": {
- "type": "object",
- "description": "The custom attributes to be set for the conversation",
- "example": {
- "order_id": "12345",
- "previous_conversation": "67890"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "custom_attributes"
+ ],
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes to be set for the conversation",
+ "example": {
+ "order_id": "12345",
+ "previous_conversation": "67890"
+ }
}
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "object",
- "properties": {
- "custom_attributes": {
+ "content": {
+ "application/json": {
+ "schema": {
"type": "object",
- "description": "The custom attributes of the conversation"
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the conversation"
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
}
}
}
},
"404": {
- "description": "Conversation not found"
- },
- "401": {
- "description": "Unauthorized"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3590,63 +4686,79 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"post": {
"tags": [
- "Conversation Assignment"
+ "Conversation Assignments"
],
"operationId": "assign-a-conversation",
"summary": "Assign Conversation",
"description": "Assign a conversation to an agent or a team",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "assignee_id": {
- "type": "number",
- "description": "Id of the assignee user"
- },
- "team_id": {
- "type": "number",
- "description": "Id of the team. If the assignee_id is present, this param would be ignored"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "assignee_id": {
+ "type": "number",
+ "description": "Id of the assignee user",
+ "example": 1
+ },
+ "team_id": {
+ "type": "number",
+ "description": "Id of the team. If the assignee_id is present, this param would be ignored",
+ "example": 1
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
}
},
"404": {
- "description": "Conversation not found"
- },
- "401": {
- "description": "Unauthorized"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3654,72 +4766,125 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"get": {
"tags": [
- "Conversation Labels"
+ "Conversations"
],
"operationId": "list-all-labels-of-a-conversation",
"summary": "List Labels",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Lists all the labels of a conversation",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_labels"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_labels"
+ }
+ }
}
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
"post": {
"tags": [
- "Conversation Labels"
+ "Conversations"
],
"operationId": "conversation-add-labels",
"summary": "Add Labels",
- "description": "Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.",
- "parameters": [
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "labels": {
- "type": "array",
- "description": "Array of labels (comma-separated strings)",
- "items": {
- "type": "string"
+ "userApiKey": []
+ }
+ ],
+ "description": "Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "labels"
+ ],
+ "properties": {
+ "labels": {
+ "type": "array",
+ "description": "Array of labels (comma-separated strings)",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "support",
+ "billing"
+ ]
}
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/conversation_labels"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_labels"
+ }
+ }
}
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3732,27 +4897,55 @@
"operationId": "listAllInboxes",
"summary": "List all inboxes",
"description": "List all inboxes available in the current account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of inboxes",
- "items": {
- "$ref": "#/definitions/inbox"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of inboxes",
+ "items": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ }
+ }
}
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3764,15 +4957,22 @@
],
"operationId": "GetInbox",
"summary": "Get an inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get an inbox available in the current account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the inbox",
"required": true
}
@@ -3780,15 +4980,33 @@
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/inbox"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3801,73 +5019,56 @@
"operationId": "inboxCreation",
"summary": "Create an inbox",
"description": "You can create more than one website inbox in each account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the inbox"
- },
- "avatar": {
- "type": "string",
- "format": "binary",
- "description": "File for avatar image"
- },
- "channel": {
- "type": "object",
- "properties": {
- "type": {
- "type": "string",
- "enum": [
- "web_widget"
- ]
- },
- "website_url": {
- "type": "string",
- "description": "URL at which the widget will be loaded"
- },
- "welcome_title": {
- "type": "string",
- "description": "Welcome title to be displayed on the widget"
- },
- "welcome_tagline": {
- "type": "string",
- "description": "Welcome tagline to be displayed on the widget"
- },
- "agent_away_message": {
- "type": "string",
- "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected"
- },
- "widget_color": {
- "type": "string",
- "description": "A Hex-color string used to customize the widget"
- }
- }
- }
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox_create_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/inbox"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3879,82 +5080,66 @@
],
"operationId": "updateInbox",
"summary": "Update Inbox",
- "description": "Add avatar and disable auto assignment for an inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update an existing inbox",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the inbox",
"required": true
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "enable_auto_assignment"
- ],
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the inbox"
- },
- "enable_auto_assignment": {
- "type": "boolean",
- "description": "Enable Auto Assignment"
- },
- "avatar": {
- "type": "string",
- "format": "binary",
- "description": "Image file for avatar"
- },
- "channel": {
- "type": "object",
- "properties": {
- "website_url": {
- "type": "string",
- "description": "URL at which the widget will be loaded"
- },
- "welcome_title": {
- "type": "string",
- "description": "Welcome title to be displayed on the widget"
- },
- "welcome_tagline": {
- "type": "string",
- "description": "Welcome tagline to be displayed on the widget"
- },
- "agent_away_message": {
- "type": "string",
- "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected"
- },
- "widget_color": {
- "type": "string",
- "description": "A Hex-color string used to customize the widget"
- }
- }
- }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox_update_payload"
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/inbox"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -3967,14 +5152,21 @@
"operationId": "getInboxAgentBot",
"summary": "Show Inbox Agent Bot",
"description": "See if an agent bot is associated to the Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the inbox",
"required": true
}
@@ -3982,15 +5174,33 @@
"responses": {
"204": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/agent_bot"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
}
},
"404": {
- "description": "Inbox not found, Agent bot not found"
+ "description": "Inbox not found, Agent bot not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4002,45 +5212,69 @@
],
"operationId": "updateAgentBot",
"summary": "Add or remove agent bot",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null",
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"name": "id",
"in": "path",
- "type": "number",
+ "schema": {
+ "type": "number"
+ },
"description": "ID of the inbox",
"required": true
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "agent_bot"
- ],
- "properties": {
- "agent_bot": {
- "type": "number",
- "description": "Agent bot ID"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "agent_bot"
+ ],
+ "properties": {
+ "agent_bot": {
+ "type": "number",
+ "description": "Agent bot ID",
+ "example": 1
+ }
}
}
}
}
- ],
+ },
"responses": {
"204": {
"description": "Success"
},
"404": {
- "description": "Inbox not found, Agent bot not found"
+ "description": "Inbox not found, Agent bot not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4048,10 +5282,10 @@
"/api/v1/accounts/{account_id}/inbox_members/{inbox_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/inbox_id"
+ "$ref": "#/components/parameters/inbox_id"
}
],
"get": {
@@ -4063,32 +5297,53 @@
"description": "Get Details of Agents in an Inbox",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
- "$ref": "#/parameters/inbox_id"
+ "$ref": "#/components/parameters/inbox_id"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
}
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4096,7 +5351,7 @@
"/api/v1/accounts/{account_id}/inbox_members": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"post": {
@@ -4108,57 +5363,89 @@
"description": "Add a new Agent to Inbox",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "inbox_id",
- "user_ids"
- ],
- "properties": {
- "inbox_id": {
- "type": "string",
- "description": "The ID of the inbox"
- },
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "integer",
+ "description": "The ID of the inbox",
+ "example": 1
},
- "description": "IDs of users to be added to the inbox"
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the inbox",
+ "example": [
+ 1
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
}
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4171,57 +5458,89 @@
"description": "All agents except the one passed in params will be removed",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "inbox_id",
- "user_ids"
- ],
- "properties": {
- "inbox_id": {
- "type": "string",
- "description": "The ID of the inbox"
- },
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "string",
+ "description": "The ID of the inbox",
+ "example": 1
},
- "description": "IDs of users to be added to the inbox"
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the inbox",
+ "example": [
+ 1
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
}
}
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4234,50 +5553,69 @@
"description": "Remove an Agent from Inbox",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "inbox_id",
- "user_ids"
- ],
- "properties": {
- "inbox_id": {
- "type": "string",
- "description": "The ID of the inbox"
- },
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "string",
+ "description": "The ID of the inbox"
},
- "description": "IDs of users to be deleted from the inbox"
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be deleted from the inbox"
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success"
},
"404": {
- "description": "Inbox not found"
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4285,10 +5623,10 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
}
],
"get": {
@@ -4297,30 +5635,79 @@
],
"operationId": "list-all-messages",
"summary": "Get messages",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "List all messages of a conversation",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of messages",
- "items": {
- "allOf": [
- {
- "$ref": "#/definitions/generic_id"
- },
- {
- "$ref": "#/definitions/message"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "additional_attributes": {
+ "type": "object"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/agent"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "Array of messages",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ }
}
- ]
+ }
}
}
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4333,45 +5720,59 @@
"description": "Create a new message in the conversation",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
},
{
- "agentBotApiKey": [
-
- ]
+ "agentBotApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/conversation_message_create"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_message_create_payload"
+ }
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "allOf": [
- {
- "$ref": "#/definitions/generic_id"
- },
- {
- "$ref": "#/definitions/message"
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/message"
+ }
+ ]
}
- ]
+ }
}
},
"404": {
- "description": "Conversation not found"
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4379,13 +5780,13 @@
"/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/conversation_id"
+ "$ref": "#/components/parameters/conversation_id"
},
{
- "$ref": "#/parameters/message_id"
+ "$ref": "#/components/parameters/message_id"
}
],
"delete": {
@@ -4394,16 +5795,35 @@
],
"operationId": "delete-a-message",
"summary": "Delete a message",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Delete a message and it's attachments from the conversation.",
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The message or conversation does not exist in the account"
+ "description": "The message or conversation does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4411,7 +5831,7 @@
"/api/v1/accounts/{account_id}/integrations/apps": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -4420,23 +5840,51 @@
],
"operationId": "get-details-of-all-integrations",
"summary": "List all the Integrations",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get the details of all Integrations available for the account",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of Integration apps",
- "items": {
- "$ref": "#/definitions/integrations_app"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of Integration apps",
+ "items": {
+ "$ref": "#/components/schemas/integrations_app"
+ }
+ }
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "Url not found"
+ "description": "Url not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4449,28 +5897,46 @@
"operationId": "create-an-integration-hook",
"summary": "Create an integration hook",
"description": "Create an integration hook",
- "parameters": [
+ "security": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/integrations_hook_create_payload"
- }
+ "userApiKey": []
}
],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook_create_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/integrations_hook"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4483,31 +5949,49 @@
"operationId": "update-an-integrations-hook",
"summary": "Update an Integration Hook",
"description": "Update an Integration Hook",
- "parameters": [
+ "security": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "$ref": "#/parameters/hook_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/integrations_hook_update_payload"
- }
+ "userApiKey": []
}
],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/hook_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/integrations_hook"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4518,12 +6002,17 @@
"operationId": "delete-an-integration-hook",
"summary": "Delete an Integration Hook",
"description": "Delete an Integration Hook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/hook_id"
+ "$ref": "#/components/parameters/hook_id"
}
],
"responses": {
@@ -4531,10 +6020,24 @@
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The hook does not exist in the account"
+ "description": "The hook does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4547,15 +6050,31 @@
"operationId": "fetchProfile",
"summary": "Fetch user profile",
"description": "Get the user profile details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/user"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4563,7 +6082,7 @@
"/api/v1/accounts/{account_id}/teams": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -4572,20 +6091,36 @@
],
"operationId": "list-all-teams",
"summary": "List all teams",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "List all teams available in the current account",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of teams",
- "items": {
- "$ref": "#/definitions/team"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of teams",
+ "items": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4595,29 +6130,47 @@
],
"operationId": "create-a-team",
"summary": "Create a team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Create a team in the account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/team_create_update_payload"
- }
+ "$ref": "#/components/parameters/account_id"
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/team"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4625,10 +6178,10 @@
"/api/v1/accounts/{account_id}/teams/{team_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/team_id"
+ "$ref": "#/components/parameters/team_id"
}
],
"get": {
@@ -4637,19 +6190,42 @@
],
"operationId": "get-details-of-a-single-team",
"summary": "Get a team details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get the details of a team in the account",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/team"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given team ID does not exist in the account"
+ "description": "The given team ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4659,26 +6235,42 @@
],
"operationId": "update-a-team",
"summary": "Update a team",
- "description": "Update a team's attributes",
- "parameters": [
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/team_create_update_payload"
- }
+ "userApiKey": []
}
],
+ "description": "Update a team's attributes",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/team"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4688,16 +6280,35 @@
],
"operationId": "delete-a-team",
"summary": "Delete a team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Delete a team from the account",
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The team does not exist in the account"
+ "description": "The team does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4705,10 +6316,10 @@
"/api/v1/accounts/{account_id}/teams/{team_id}/team_members": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/team_id"
+ "$ref": "#/components/parameters/team_id"
}
],
"get": {
@@ -4720,35 +6331,51 @@
"description": "Get Details of Agents in an Team",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/team_id"
+ "$ref": "#/components/parameters/team_id"
}
],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all agents in the team",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all agents in the team",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
}
}
},
"404": {
- "description": "Inbox not found"
- },
- "403": {
- "description": "Access denied"
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4761,52 +6388,78 @@
"description": "Add a new Agent to Team",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "user_ids"
- ],
- "properties": {
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
- },
- "description": "IDs of users to be added to the team"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the team",
+ "example": [
+ 1
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
}
}
},
"404": {
- "description": "Team not found"
- },
- "403": {
- "description": "Access denied"
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4819,52 +6472,78 @@
"description": "All agents except the one passed in params will be removed",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "user_ids"
- ],
- "properties": {
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
- },
- "description": "IDs of users to be added to the team"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the team",
+ "example": [
+ 1
+ ]
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of all agents in the team",
- "items": {
- "$ref": "#/definitions/agent"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all agents in the team",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
}
}
},
"404": {
- "description": "Team not found"
- },
- "403": {
- "description": "Access denied"
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4877,46 +6556,64 @@
"description": "Remove an Agent from Team",
"security": [
{
- "userApiKey": [
-
- ]
+ "userApiKey": []
}
],
- "parameters": [
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "type": "object",
- "required": [
- "team_id",
- "user_ids"
- ],
- "properties": {
- "user_ids": {
- "type": "array",
- "items": {
- "type": "integer"
- },
- "description": "IDs of users to be deleted from the team"
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be deleted from the team"
+ }
}
}
}
}
- ],
+ },
"responses": {
"200": {
"description": "Success"
},
- "404": {
- "description": "Team not found"
- },
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"422": {
- "description": "User must exist"
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4924,17 +6621,19 @@
"/api/v1/accounts/{account_id}/custom_filters": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"in": "query",
"name": "filter_type",
- "type": "string",
- "enum": [
- "conversation",
- "contact",
- "report"
- ],
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ]
+ },
"required": false,
"description": "The type of custom filter"
}
@@ -4946,19 +6645,35 @@
"operationId": "list-all-filters",
"summary": "List all custom filters",
"description": "List all custom filters in a category of a user",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of custom filters",
- "items": {
- "$ref": "#/definitions/custom_filter"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of custom filters",
+ "items": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -4971,26 +6686,44 @@
"description": "Create a custom filter in the account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/custom_filter_create_update_payload"
- }
+ "$ref": "#/components/parameters/account_id"
}
],
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_filter"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4998,10 +6731,10 @@
"/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/custom_filter_id"
+ "$ref": "#/components/parameters/custom_filter_id"
}
],
"get": {
@@ -5011,18 +6744,41 @@
"operationId": "get-details-of-a-single-custom-filter",
"summary": "Get a custom filter details",
"description": "Get the details of a custom filter in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_filter"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The given team ID does not exist in the account"
+ "description": "The given team ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -5032,26 +6788,42 @@
],
"operationId": "update-a-custom-filter",
"summary": "Update a custom filter",
- "description": "Update a custom filter's attributes",
- "parameters": [
+ "security": [
{
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/custom_filter_create_update_payload"
- }
+ "userApiKey": []
}
],
+ "description": "Update a custom filter's attributes",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/custom_filter"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -5061,16 +6833,35 @@
],
"operationId": "delete-a-custom-filter",
"summary": "Delete a custom filter",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Delete a custom filter from the account",
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"404": {
- "description": "The custom filter does not exist in the account"
+ "description": "The custom filter does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5078,7 +6869,7 @@
"/api/v1/accounts/{account_id}/webhooks": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
}
],
"get": {
@@ -5087,20 +6878,36 @@
],
"operationId": "list-all-webhooks",
"summary": "List all webhooks",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "List all webhooks in the account",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of webhook objects",
- "items": {
- "$ref": "#/definitions/webhook"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of webhook objects",
+ "items": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
}
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -5110,29 +6917,47 @@
],
"operationId": "create-a-webhook",
"summary": "Add a webhook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Add a webhook subscription to the account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/webhook_create_update_payload"
- }
+ "$ref": "#/components/parameters/account_id"
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/webhook"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5140,10 +6965,10 @@
"/api/v1/accounts/{account_id}/webhooks/{webhook_id}": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/webhook_id"
+ "$ref": "#/components/parameters/webhook_id"
}
],
"patch": {
@@ -5152,29 +6977,47 @@
],
"operationId": "update-a-webhook",
"summary": "Update a webhook object",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Update a webhook object in the account",
"parameters": [
{
- "$ref": "#/parameters/account_id"
- },
- {
- "name": "data",
- "in": "body",
- "required": true,
- "schema": {
- "$ref": "#/definitions/webhook_create_update_payload"
- }
+ "$ref": "#/components/parameters/account_id"
}
],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook_create_update_payload"
+ }
+ }
+ }
+ },
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/webhook"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
}
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
},
@@ -5184,16 +7027,35 @@
],
"operationId": "delete-a-webhook",
"summary": "Delete a webhook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Delete a webhook from the account",
"responses": {
"200": {
"description": "Success"
},
"401": {
- "description": "Unauthorized"
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object"
+ }
+ }
+ }
},
"404": {
- "description": "The webhook does not exist in the account"
+ "description": "The webhook does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5201,30 +7063,36 @@
"/api/v2/accounts/{account_id}/reports": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/report_metric"
+ "$ref": "#/components/parameters/report_metric"
},
{
- "$ref": "#/parameters/report_type"
+ "$ref": "#/components/parameters/report_type"
},
{
"in": "query",
"name": "id",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The Id of specific object in case of agent/inbox/label"
},
{
"in": "query",
"name": "since",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The timestamp from where report should start."
},
{
"in": "query",
"name": "until",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The timestamp from where report should stop."
}
],
@@ -5234,31 +7102,54 @@
],
"operationId": "list-all-conversation-statistics",
"summary": "Get Account reports",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get Account reports for a specific type, metric and date range",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of date based conversation statistics",
- "items": {
- "type": "object",
- "properties": {
- "value": {
- "type": "string"
- },
- "timestamp": {
- "type": "number"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of date based conversation statistics",
+ "items": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "number"
+ }
+ }
}
}
}
}
},
"404": {
- "description": "reports not found"
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5266,27 +7157,33 @@
"/api/v2/accounts/{account_id}/reports/summary": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
- "$ref": "#/parameters/report_type"
+ "$ref": "#/components/parameters/report_type"
},
{
"in": "query",
"name": "id",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The Id of specific object in case of agent/inbox/label"
},
{
"in": "query",
"name": "since",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The timestamp from where report should start."
},
{
"in": "query",
"name": "until",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The timestamp from where report should stop."
}
],
@@ -5296,19 +7193,42 @@
],
"operationId": "list-all-conversation-statistics-summary",
"summary": "Get Account reports summary",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get Account reports summary for a specific type and date range",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "$ref": "#/definitions/account_summary"
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_summary"
+ }
+ }
}
},
"404": {
- "description": "reports not found"
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5316,15 +7236,17 @@
"/api/v2/accounts/{account_id}/reports/conversations": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"in": "query",
"name": "type",
- "type": "string",
- "enum": [
- "account"
- ],
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account"
+ ]
+ },
"required": true,
"description": "Type of report"
}
@@ -5335,31 +7257,54 @@
],
"operationId": "get-account-conversation-metrics",
"summary": "Account Conversation Metrics",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get conversation metrics for Account",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "object",
- "description": "Object of account conversation metrics",
- "properties": {
- "open": {
- "type": "number"
- },
- "unattended": {
- "type": "number"
- },
- "unassigned": {
- "type": "number"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "Object of account conversation metrics",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ },
+ "unassigned": {
+ "type": "number"
+ }
+ }
}
}
}
},
"404": {
- "description": "reports not found"
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -5367,22 +7312,26 @@
"/api/v2/accounts/{account_id}/reports/conversations/": {
"parameters": [
{
- "$ref": "#/parameters/account_id"
+ "$ref": "#/components/parameters/account_id"
},
{
"in": "query",
"name": "type",
- "type": "string",
- "enum": [
- "agent"
- ],
+ "schema": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ]
+ },
"required": true,
"description": "Type of report"
},
{
"in": "query",
"name": "user_id",
- "type": "string",
+ "schema": {
+ "type": "string"
+ },
"description": "The numeric ID of the user"
}
],
@@ -5392,376 +7341,43 @@
],
"operationId": "get-agent-conversation-metrics",
"summary": "Agent Conversation Metrics",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
"description": "Get conversation metrics for Agent",
"responses": {
"200": {
"description": "Success",
- "schema": {
- "type": "array",
- "description": "Array of agent based conversation metrics",
- "items": {
- "$ref": "#/definitions/agent_conversation_metrics"
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent based conversation metrics",
+ "items": {
+ "$ref": "#/components/schemas/agent_conversation_metrics"
+ }
+ }
}
}
},
"404": {
- "description": "reports not found"
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
},
"403": {
- "description": "Access denied"
- }
- }
- }
- }
- },
- "definitions": {
- "bad_request_error": {
- "title": "data",
- "type": "object",
- "properties": {
- "description": {
- "type": "string"
- },
- "errors": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/request_error"
- }
- }
- }
- },
- "request_error": {
- "type": "object",
- "properties": {
- "field": {
- "type": "string"
- },
- "message": {
- "type": "string"
- },
- "code": {
- "type": "string"
- }
- }
- },
- "generic_id": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number"
- }
- }
- },
- "canned_response": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "ID of the canned response"
- },
- "content": {
- "type": "string",
- "description": "Message content for canned response"
- },
- "short_code": {
- "type": "string",
- "description": "Short Code for quick access of the canned response"
- },
- "account_id": {
- "type": "integer",
- "description": "Account Id"
- }
- }
- },
- "custom_attribute": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Identifier"
- },
- "attribute_display_name": {
- "type": "string",
- "description": "Attribute display name"
- },
- "attribute_display_type": {
- "type": "string",
- "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
- },
- "attribute_description": {
- "type": "string",
- "description": "Attribute description"
- },
- "attribute_key": {
- "type": "string",
- "description": "Attribute unique key value"
- },
- "attribute_values": {
- "type": "string",
- "description": "Attribute values"
- },
- "default_value": {
- "type": "string",
- "description": "Attribute default value"
- },
- "attribute_model": {
- "type": "string",
- "description": "Attribute type(conversation_attribute/contact_attribute)"
- },
- "account_id": {
- "type": "integer",
- "description": "Account Id"
- }
- }
- },
- "automation_rule": {
- "type": "object",
- "properties": {
- "event_name": {
- "type": "string",
- "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
- "enum": [
- "conversation_created",
- "conversation_updated",
- "message_created"
- ],
- "example": "message_created"
- },
- "name": {
- "type": "string",
- "description": "The name of the rule",
- "example": "Add label on message create event"
- },
- "description": {
- "type": "string",
- "description": "Description to give more context about the rule",
- "example": "Add label support and sales on message create event if incoming message content contains text help"
- },
- "active": {
- "type": "boolean",
- "description": "Enable/disable automation rule"
- },
- "actions": {
- "type": "array",
- "description": "Array of actions which we perform when condition matches",
- "items": {
- "type": "object",
- "example": {
- "action_name": "add_label",
- "action_params": [
- "support",
- "sales"
- ]
- }
- }
- },
- "conditions": {
- "type": "array",
- "description": "Array of conditions on which conversation/message filter would work",
- "items": {
- "type": "object",
- "example": {
- "attribute_key": "content",
- "filter_operator": "contains",
- "values": [
- "help"
- ],
- "query_operator": "nil"
- }
- }
- },
- "account_id": {
- "type": "integer",
- "description": "Account Id"
- }
- }
- },
- "portal": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "archived": {
- "type": "boolean"
- },
- "color": {
- "type": "string"
- },
- "config": {
- "type": "object",
- "description": "Save information about locales, allowed_locales and default portal/help-center locale"
- },
- "custom_domain": {
- "type": "string"
- },
- "header_text": {
- "type": "string",
- "description": "The text content."
- },
- "homepage_link": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "slug": {
- "type": "string"
- },
- "page_title": {
- "type": "string"
- },
- "account_id": {
- "type": "integer"
- },
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/category"
- }
- },
- "articles": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/article"
- }
- }
- }
- },
- "category": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "description": {
- "type": "string",
- "description": "The text content."
- },
- "locale": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "slug": {
- "type": "string"
- },
- "position": {
- "type": "integer"
- },
- "portal_id": {
- "type": "integer"
- },
- "account_id": {
- "type": "integer"
- },
- "associated_category_id": {
- "type": "integer",
- "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
- },
- "parent_category_id": {
- "type": "integer",
- "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
- }
- }
- },
- "article": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "content": {
- "type": "string",
- "description": "The text content."
- },
- "meta": {
- "type": "object"
- },
- "position": {
- "type": "integer"
- },
- "status": {
- "type": "integer",
- "enum": [
- "draft",
- "published",
- "archived"
- ]
- },
- "title": {
- "type": "string"
- },
- "slug": {
- "type": "string"
- },
- "views": {
- "type": "integer"
- },
- "portal_id": {
- "type": "integer"
- },
- "account_id": {
- "type": "integer"
- },
- "author_id": {
- "type": "integer"
- },
- "category_id": {
- "type": "integer"
- },
- "folder_id": {
- "type": "integer"
- },
- "associated_article_id": {
- "type": "integer",
- "description": "To associate similar articles to each other, e.g to provide the link for the reference."
- }
- }
- },
- "contact": {
- "type": "object",
- "properties": {
- "payload": {
- "type": "object",
- "properties": {
- "contact": {
- "type": "object",
- "properties": {
- "email": {
- "type": "string",
- "description": "Email address of the contact"
- },
- "name": {
- "type": "string",
- "description": "The name of the contact"
- },
- "phone_number": {
- "type": "string",
- "description": "Phone number of the contact"
- },
- "thumbnail": {
- "type": "string",
- "description": "Avatar URL of the contact"
- },
- "additional_attributes": {
- "type": "object",
- "description": "The object containing additional attributes related to the contact"
- },
- "custom_attributes": {
- "type": "object",
- "description": "The object to save custom attributes for contact, accepts custom attributes key and value",
- "example": {
- "attribute_key": "attribute_value",
- "signed_up_at": "dd/mm/yyyy"
- }
- },
- "contact_inboxes": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/contact_inboxes"
- }
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
}
}
}
@@ -5769,1341 +7385,3251 @@
}
}
},
- "conversation": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID of the conversation"
+ "/accounts/{account_id}/conversations/{conversation_id}/messages": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
},
- "messages": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/message"
- }
- },
- "account_id": {
- "type": "number",
- "description": "Account Id"
- },
- "inbox_id": {
- "type": "number",
- "description": "ID of the inbox"
- },
- "status": {
- "type": "string",
- "enum": [
- "open",
- "resolved",
- "pending"
- ],
- "description": "The status of the conversation"
- },
- "timestamp": {
- "type": "string",
- "description": "The time at which conversation was created"
- },
- "contact_last_seen_at": {
- "type": "string"
- },
- "agent_last_seen_at": {
- "type": "string"
- },
- "unread_count": {
- "type": "number",
- "description": "The number of unread messages"
- },
- "additional_attributes": {
- "type": "object",
- "description": "The object containing additional attributes related to the conversation"
- },
- "custom_attributes": {
- "type": "object",
- "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
- "example": {
- "attribute_key": "attribute_value",
- "priority_conversation_number": 3
+ {
+ "name": "conversation_id",
+ "in": "path",
+ "description": "ID of the conversation",
+ "required": true,
+ "schema": {
+ "type": "number"
}
}
- }
- },
- "message": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string",
- "description": "The text content of the message"
- },
- "content_type": {
- "type": "string",
- "enum": [
- "text",
- "input_select",
- "cards",
- "form"
- ],
- "description": "The type of the template message"
- },
- "content_attributes": {
- "type": "object",
- "description": "The content attributes for each content_type"
- },
- "message_type": {
- "type": "string",
- "enum": [
- "incoming",
- "outgoing",
- "activity",
- "template"
- ],
- "description": "The type of the message"
- },
- "created_at": {
- "type": "integer",
- "description": "The time at which message was created"
- },
- "private": {
- "type": "boolean",
- "description": "The flags which shows whether the message is private or not"
- },
- "attachment": {
- "type": "object",
- "description": "The file object attached to the image"
- },
- "sender": {
- "type": "object",
- "description": "User/Agent/AgentBot object"
- },
- "conversation_id": {
- "type": "number",
- "description": "ID of the conversation"
- }
- }
- },
- "user": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number"
- },
- "uid": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "available_name": {
- "type": "string"
- },
- "display_name": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "account_id": {
- "type": "number"
- },
- "role": {
- "type": "string",
- "enum": [
- "agent",
- "administrator"
- ]
- },
- "confirmed": {
- "type": "boolean"
- },
- "custom_attributes": {
- "type": "object",
- "description": "Available for users who are created through platform APIs and has custom attributes associated."
- },
- "accounts": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/account"
- }
- }
- }
- },
- "agent": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer"
- },
- "uid": {
- "type": "string"
- },
- "name": {
- "type": "string"
- },
- "available_name": {
- "type": "string"
- },
- "display_name": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "account_id": {
- "type": "integer"
- },
- "role": {
- "type": "string",
- "enum": [
- "agent",
- "administrator"
- ]
- },
- "confirmed": {
- "type": "boolean"
- },
- "availability_status": {
- "type": "string",
- "enum": [
- "available",
- "busy",
- "offline"
- ],
- "description": "The availability status of the agent computed by Chatwoot."
- },
- "auto_offline": {
- "type": "boolean",
- "description": "Whether the availability status of agent is configured to go offline automatically when away."
- },
- "custom_attributes": {
- "type": "object",
- "description": "Available for users who are created through platform APIs and has custom attributes associated."
- }
- }
- },
- "inbox": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID of the inbox"
- },
- "name": {
- "type": "string",
- "description": "The name of the inbox"
- },
- "website_url": {
- "type": "string",
- "description": "Website URL"
- },
- "channel_type": {
- "type": "string",
- "description": "The type of the inbox"
- },
- "avatar_url": {
- "type": "string",
- "description": "The avatar image of the inbox"
- },
- "widget_color": {
- "type": "string",
- "description": "Widget Color used for customization of the widget"
- },
- "website_token": {
- "type": "string",
- "description": "Website Token"
- },
- "enable_auto_assignment": {
- "type": "boolean",
- "description": "The flag which shows whether Auto Assignment is enabled or not"
- },
- "web_widget_script": {
- "type": "string",
- "description": "Script used to load the website widget"
- },
- "welcome_title": {
- "type": "string",
- "description": "Welcome title to be displayed on the widget"
- },
- "welcome_tagline": {
- "type": "string",
- "description": "Welcome tagline to be displayed on the widget"
- },
- "greeting_enabled": {
- "type": "boolean",
- "description": "The flag which shows whether greeting is enabled"
- },
- "greeting_message": {
- "type": "string",
- "description": "A greeting message when the user starts the conversation"
- }
- }
- },
- "agent_bot": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID of the agent bot"
- },
- "name": {
- "type": "string",
- "description": "The name of the agent bot"
- },
- "description": {
- "type": "string",
- "description": "The description about the agent bot"
- },
- "account_id": {
- "type": "number",
- "description": "Account ID if it's an account specific bot"
- },
- "outgoing_url": {
- "type": "string",
- "description": "The webhook URL for the bot"
- }
- }
- },
- "contact_inboxes": {
- "type": "object",
- "properties": {
- "source_id": {
- "type": "string",
- "description": "Contact Inbox Source Id"
- },
- "inbox": {
- "$ref": "#/definitions/inbox"
- }
- }
- },
- "contactable_inboxes": {
- "type": "object",
- "properties": {
- "source_id": {
- "type": "string",
- "description": "Contact Inbox Source Id"
- },
- "inbox": {
- "$ref": "#/definitions/inbox"
- }
- }
- },
- "custom_filter": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "The ID of the custom filter"
- },
- "name": {
- "type": "string",
- "description": "The name of the custom filter"
- },
- "type": {
- "type": "string",
- "enum": [
- "conversation",
- "contact",
- "report"
- ],
- "description": "The description about the custom filter"
- },
- "query": {
- "type": "object",
- "description": "A query that needs to be saved as a custom filter"
- },
- "created_at": {
- "type": "string",
- "format": "date-time",
- "description": "The time at which the custom filter was created"
- },
- "updated_at": {
- "type": "string",
- "format": "date-time",
- "description": "The time at which the custom filter was updated"
- }
- }
- },
- "webhook": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "The ID of the webhook"
- },
- "url": {
- "type": "string",
- "description": "The url to which the events will be send"
- },
- "subscriptions": {
- "type": "array",
- "items": {
- "type": "string",
- "enum": [
- "conversation_created",
- "conversation_status_changed",
- "conversation_updated",
- "contact_created",
- "contact_updated",
- "message_created",
- "message_updated",
- "webwidget_triggered"
- ]
- },
- "description": "The list of subscribed events"
- },
- "account_id": {
- "type": "number",
- "description": "The id of the account which the webhook object belongs to"
- }
- }
- },
- "account": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "Account ID"
- },
- "name": {
- "type": "string",
- "description": "Name of the account"
- },
- "role": {
- "type": "string",
- "enum": [
- "administrator",
- "agent"
- ],
- "description": "The user role in the account"
- }
- }
- },
- "platform_account": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "Account ID"
- },
- "name": {
- "type": "string",
- "description": "Name of the account"
- }
- }
- },
- "team": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "The ID of the team"
- },
- "name": {
- "type": "string",
- "description": "The name of the team"
- },
- "description": {
- "type": "string",
- "description": "The description about the team"
- },
- "allow_auto_assign": {
- "type": "boolean",
- "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
- },
- "account_id": {
- "type": "number",
- "description": "The ID of the account with the team is a part of"
- },
- "is_member": {
- "type": "boolean",
- "description": "This field shows whether the current user is a part of the team"
- }
- }
- },
- "integrations_app": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "description": "The ID of the integration"
- },
- "name": {
- "type": "string",
- "description": "The name of the integration"
- },
- "description": {
- "type": "string",
- "description": "The description about the team"
- },
- "hook_type": {
- "type": "string",
- "description": "Whether the integration is an account or inbox integration"
- },
- "enabled": {
- "type": "boolean",
- "description": "Whether the integration is enabled for the account"
- },
- "allow_multiple_hooks": {
- "type": "boolean",
- "description": "Whether multiple hooks can be created for the integration"
- },
- "hooks": {
- "type": "array",
- "items": {
- "type": "object"
- },
- "description": "If there are any hooks created for this integration"
- }
- }
- },
- "integrations_hook": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "description": "The ID of the integration hook"
- },
- "app_id": {
- "type": "string",
- "description": "The ID of the integration app"
- },
- "inbox_id": {
- "type": "string",
- "description": "Inbox ID if its an Inbox integration"
- },
- "account_id": {
- "type": "string",
- "description": "Account ID of the integration"
- },
- "status": {
- "type": "boolean",
- "description": "Whether the integration hook is enabled for the account"
- },
- "hook_type": {
- "type": "boolean",
- "description": "Whether its an account or inbox integration hook"
- },
- "settings": {
- "type": "object",
- "description": "The associated settings for the integration"
- }
- }
- },
- "public_contact": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Id of the contact"
- },
- "source_id": {
- "type": "string",
- "description": "The session identifier of the contact"
- },
- "name": {
- "type": "string",
- "description": "Name of the contact"
- },
- "email": {
- "type": "string",
- "description": "Email of the contact"
- },
- "pubsub_token": {
- "type": "string",
- "description": "The token to be used to connect to chatwoot websocket"
- }
- }
- },
- "public_conversation": {
- "type": "object",
- "properties": {
- "id": {
- "type": "integer",
- "description": "Id of the conversation"
- },
- "inbox_id": {
- "type": "string",
- "description": "The inbox id of the conversation"
- },
- "messages": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/message"
- },
- "description": "Messages in the conversation"
- },
- "contact": {
- "type": "object",
- "description": "The contact information associated to the conversation"
- }
- }
- },
- "public_message": {
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "description": "Id of the message"
- },
- "content": {
- "type": "string",
- "description": "Text content of the message"
- },
- "message_type": {
- "type": "string",
- "description": "Denotes the message type"
- },
- "content_type": {
- "type": "string",
- "description": "Content type of the message"
- },
- "content_attributes": {
- "type": "string",
- "description": "Additional content attributes of the message"
- },
- "created_at": {
- "type": "string",
- "description": "Created at time stamp of the message"
- },
- "conversation_id": {
- "type": "string",
- "description": "Conversation Id of the message"
- },
- "attachments": {
- "type": "array",
- "items": {
- "type": "object"
- },
- "description": "Attachments if any"
- },
- "sender": {
- "type": "object",
- "description": "Details of the sender"
- }
- }
- },
- "public_inbox": {
- "type": "object",
- "properties": {
- "identifier": {
- "type": "string",
- "description": "Inbox identifier"
- },
- "name": {
- "type": "string",
- "description": "Name of the inbox"
- },
- "timezone": {
- "type": "string",
- "description": "The timezone defined on the inbox"
- },
- "working_hours": {
- "type": "array",
- "description": "The working hours defined on the inbox",
- "items": {
- "type": "object",
- "properties": {
- "day_of_week": {
- "type": "integer",
- "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
- },
- "open_all_day": {
- "type": "boolean",
- "description": "Whether or not the business is open the whole day"
- },
- "closed_all_day": {
- "type": "boolean",
- "description": "Whether or not the business is closed the whole day"
- },
- "open_hour": {
- "type": "integer",
- "description": "Opening hour. Can be null if closed all day"
- },
- "open_minutes": {
- "type": "integer",
- "description": "Opening minute. Can be null if closed all day"
- },
- "close_hour": {
- "type": "integer",
- "description": "Closing hour. Can be null if closed all day"
- },
- "close_minutes": {
- "type": "integer",
- "description": "Closing minute. Can be null if closed all day"
+ ],
+ "get": {
+ "tags": [
+ "Conversation"
+ ],
+ "summary": "Get messages from a conversation",
+ "description": "Returns all messages from a specific conversation",
+ "operationId": "getConversationMessages",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_messages"
+ }
}
}
}
- },
- "working_hours_enabled": {
- "type": "boolean",
- "description": "Whether of not the working hours are enabled on the inbox"
- },
- "csat_survey_enabled": {
- "type": "boolean",
- "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
- },
- "greeting_enabled": {
- "type": "boolean",
- "description": "Whether of not the Greeting Message is enabled on the inbox"
- },
- "identity_validation_enabled": {
- "type": "boolean",
- "description": "Whether of not the User Identity Validation is enforced on the inbox"
}
}
- },
- "account_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the account"
+ }
+ },
+ "components": {
+ "schemas": {
+ "bad_request_error": {
+ "title": "data",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/request_error"
+ }
+ }
}
- }
- },
- "agent_bot_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the agent bot"
- },
- "description": {
- "type": "string",
- "description": "The description about the agent bot"
- },
- "outgoing_url": {
- "type": "string",
- "description": "The webhook URL for the bot"
- }
- }
- },
- "user_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the user"
- },
- "email": {
- "type": "string",
- "description": "Email of the user"
- },
- "password": {
- "type": "string",
- "description": "Password must contain uppercase, lowercase letters, number and a special character"
- },
- "custom_attributes": {
- "type": "object",
- "description": "Custom attributes you want to associate with the user"
- }
- }
- },
- "canned_response_create_update_payload": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string",
- "description": "Message content for canned response"
- },
- "short_code": {
- "type": "string",
- "description": "Short Code for quick access of the canned response"
- }
- }
- },
- "custom_attribute_create_update_payload": {
- "type": "object",
- "properties": {
- "attribute_display_name": {
- "type": "string",
- "description": "Attribute display name"
- },
- "attribute_display_type": {
- "type": "integer",
- "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)"
- },
- "attribute_description": {
- "type": "string",
- "description": "Attribute description"
- },
- "attribute_key": {
- "type": "string",
- "description": "Attribute unique key value"
- },
- "attribute_values": {
- "type": "array",
- "description": "Attribute values",
- "items": {
+ },
+ "request_error": {
+ "type": "object",
+ "properties": {
+ "field": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "code": {
"type": "string"
}
- },
- "attribute_model": {
- "type": "integer",
- "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)"
}
- }
- },
- "contact_create": {
- "type": "object",
- "required": [
- "inbox_id"
- ],
- "properties": {
- "inbox_id": {
- "type": "number"
- },
- "name": {
- "type": "string",
- "description": "name of the contact"
- },
- "email": {
- "type": "string",
- "description": "email of the contact"
- },
- "phone_number": {
- "type": "string",
- "description": "phone number of the contact"
- },
- "avatar": {
- "type": "string",
- "format": "binary",
- "description": "Send the form data with the avatar image binary or use the avatar_url"
- },
- "avatar_url": {
- "type": "string",
- "description": "The url to a jpeg, png file for the contact avatar"
- },
- "identifier": {
- "type": "string",
- "description": "A unique identifier for the contact in external system"
- },
- "custom_attributes": {
- "type": "object",
- "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}"
+ },
+ "generic_id": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ }
}
- }
- },
- "contact_update": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "name of the contact"
- },
- "email": {
- "type": "string",
- "description": "email of the contact"
- },
- "phone_number": {
- "type": "string",
- "description": "phone number of the contact"
- },
- "avatar": {
- "type": "string",
- "format": "binary",
- "description": "Send the form data with the avatar image binary or use the avatar_url"
- },
- "avatar_url": {
- "type": "string",
- "description": "The url to a jpeg, png file for the contact avatar"
- },
- "identifier": {
- "type": "string",
- "description": "A unique identifier for the contact in external system"
- },
- "custom_attributes": {
- "type": "object",
- "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}"
+ },
+ "canned_response": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the canned response"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response"
+ },
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was updated"
+ }
}
- }
- },
- "conversation_message_create": {
- "type": "object",
- "required": [
- "content"
- ],
- "properties": {
- "content": {
- "type": "string",
- "description": "The content of the message"
- },
- "message_type": {
- "type": "string",
- "enum": [
- "outgoing",
- "incoming"
- ]
- },
- "private": {
- "type": "boolean",
- "description": "Flag to identify if it is a private note"
- },
- "content_type": {
- "type": "string",
- "enum": [
- "text",
- "input_email",
- "cards",
- "input_select",
- "form",
- "article"
- ],
- "example": "cards",
- "description": "if you want to create custom message types"
- },
- "content_attributes": {
- "type": "object",
- "description": "attributes based on your content type"
- },
- "template_params": {
- "type": "object",
- "description": "The template params for the message in case of whatsapp Channel",
- "properties": {
- "name": {
- "type": "string",
- "description": "Name of the template",
- "example": "sample_issue_resolution"
- },
- "category": {
- "type": "string",
- "description": "Category of the template",
- "example": "UTILITY"
- },
- "language": {
- "type": "string",
- "description": "Language of the template",
- "example": "en_US"
- },
- "processed_params": {
+ },
+ "custom_attribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Identifier"
+ },
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name"
+ },
+ "attribute_display_type": {
+ "type": "string",
+ "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value"
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue"
+ },
+ "attribute_values": {
+ "type": "string",
+ "description": "Attribute values"
+ },
+ "attribute_model": {
+ "type": "string",
+ "description": "Attribute type(conversation_attribute/contact_attribute)"
+ },
+ "default_value": {
+ "type": "string",
+ "description": "Attribute default value"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was updated"
+ }
+ }
+ },
+ "automation_rule": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Response payload that contains automation rule(s)",
+ "oneOf": [
+ {
+ "type": "array",
+ "description": "Array of automation rules (for listing endpoint)",
+ "items": {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ },
+ {
+ "type": "object",
+ "description": "Single automation rule (for show/create/update endpoints)",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "automation_rule_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the automation rule"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the rule",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to give more context about the rule",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created"
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation/message filter would work",
+ "items": {
"type": "object",
- "description": "The processed param values for template variables in template",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attribute_key": {
+ "type": "string"
+ },
+ "query_operator": {
+ "type": "string"
+ },
+ "filter_operator": {
+ "type": "string"
+ }
+ },
"example": {
- "1": "Chatwoot"
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "values": [
+ "help"
+ ],
+ "query_operator": "and"
+ }
+ }
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which we perform when condition matches",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action_name": {
+ "type": "string"
+ },
+ "action_params": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support",
+ "sales"
+ ]
+ }
+ }
+ },
+ "created_on": {
+ "type": "integer",
+ "description": "The timestamp when the rule was created"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ }
+ }
+ },
+ "portal": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ }
+ },
+ "portal_single": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ },
+ "portal_config": {
+ "type": "object",
+ "description": "Configuration settings for the portal",
+ "properties": {
+ "allowed_locales": {
+ "type": "array",
+ "description": "List of allowed locales for the portal",
+ "items": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The language code"
+ },
+ "articles_count": {
+ "type": "integer",
+ "description": "Number of articles in this locale"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories in this locale"
+ }
}
}
}
}
- }
- },
- "team_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the team"
- },
- "description": {
- "type": "string",
- "description": "The description of the team"
- },
- "allow_auto_assign": {
- "type": "boolean",
- "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "portal_logo": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the logo file"
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "ID of the portal this logo belongs to"
+ },
+ "file_type": {
+ "type": "string",
+ "description": "MIME type of the file"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "file_url": {
+ "type": "string",
+ "description": "URL to access the logo file"
+ },
+ "blob_id": {
+ "type": "integer",
+ "description": "ID of the blob"
+ },
+ "filename": {
+ "type": "string",
+ "description": "Name of the file"
+ }
}
- }
- },
- "custom_filter_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "The name of the custom filter"
- },
- "type": {
- "type": "string",
- "enum": [
- "conversation",
- "contact",
- "report"
- ],
- "description": "The description about the custom filter"
- },
- "query": {
+ },
+ "portal_meta": {
+ "type": "object",
+ "properties": {
+ "all_articles_count": {
+ "type": "integer",
+ "description": "Total number of articles"
+ },
+ "archived_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of archived articles"
+ },
+ "published_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of published articles"
+ },
+ "draft_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of draft articles"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories"
+ },
+ "default_locale": {
+ "type": "string",
+ "description": "Default locale for the portal"
+ }
+ }
+ },
+ "portal_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the portal"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Whether the portal is archived"
+ },
+ "color": {
+ "type": "string",
+ "description": "The color code for the portal"
+ },
+ "config": {
+ "$ref": "#/components/schemas/portal_config"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain for the portal"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "The header text for the portal"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "Homepage link for the portal"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the portal"
+ },
+ "slug": {
+ "type": "string",
+ "description": "URL slug for the portal"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ },
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
+ }
+ }
+ },
+ "category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "locale": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
+ }
+ }
+ },
+ "article": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "meta": {
+ "type": "object"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "status": {
+ "type": "integer",
+ "enum": [
+ "draft",
+ "published",
+ "archived"
+ ]
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "views": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "author_id": {
+ "type": "integer"
+ },
+ "category_id": {
+ "type": "integer"
+ },
+ "folder_id": {
+ "type": "integer"
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference."
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact",
+ "example": {
+ "attribute_key": "attribute_value",
+ "signed_up_at": "dd/mm/yyyy"
+ }
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "The last activity at of the contact"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The created at of the contact"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "uuid": {
+ "type": "string",
+ "description": "UUID of the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the conversation"
+ },
+ "agent_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the agent"
+ },
+ "assignee_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the assignee"
+ },
+ "can_reply": {
+ "type": "boolean",
+ "description": "Whether the conversation can be replied to"
+ },
+ "contact_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels of the conversation"
+ },
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the conversation is muted"
+ },
+ "snoozed_until": {
+ "type": "number",
+ "description": "The time at which the conversation will be unmuted"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The time at which conversation was created"
+ },
+ "updated_at": {
+ "type": "number",
+ "description": "The time at which conversation was updated"
+ },
+ "timestamp": {
+ "type": "string",
+ "description": "The time at which conversation was created"
+ },
+ "first_reply_created_at": {
+ "type": "number",
+ "description": "The time at which the first reply was created"
+ },
+ "unread_count": {
+ "type": "number",
+ "description": "The number of unread messages"
+ },
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the conversation"
+ },
+ "priority": {
+ "type": "string",
+ "description": "The priority of the conversation"
+ },
+ "waiting_since": {
+ "type": "number",
+ "description": "The time at which the conversation was waiting"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy"
+ },
+ "applied_sla": {
+ "type": "object",
+ "description": "The applied SLA"
+ },
+ "sla_events": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "SLA event objects"
+ }
+ }
+ }
+ },
+ "message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "description": "The type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The time at which message was created"
+ },
+ "updated_at": {
+ "type": "integer",
+ "description": "The time at which message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flags which shows whether the message is private or not"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form"
+ ],
+ "description": "The type of the template message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type"
+ },
+ "sender_type": {
+ "type": "string",
+ "enum": [
+ "contact",
+ "agent",
+ "agent_bot"
+ ],
+ "description": "The type of the sender"
+ },
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "The external source IDs of the message"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "The processed message content"
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "The sentiment of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "The conversation object"
+ },
+ "attachment": {
+ "type": "object",
+ "description": "The file object attached to the image"
+ },
+ "sender": {
+ "type": "object",
+ "description": "User/Agent/AgentBot object"
+ }
+ }
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "access_token": {
+ "type": "string"
+ },
+ "account_id": {
+ "type": "number"
+ },
+ "available_name": {
+ "type": "string"
+ },
+ "avatar_url": {
+ "type": "string"
+ },
+ "confirmed": {
+ "type": "boolean"
+ },
+ "display_name": {
+ "type": "string",
+ "nullable": true
+ },
+ "message_signature": {
+ "type": "string",
+ "nullable": true
+ },
+ "email": {
+ "type": "string"
+ },
+ "hmac_identifier": {
+ "type": "string"
+ },
+ "inviter_id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "pubsub_token": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ]
+ },
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Available for users who are created through platform APIs and has custom attributes associated."
+ },
+ "accounts": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "active_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ]
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "availability": {
+ "type": "string"
+ },
+ "availability_status": {
+ "type": "string"
+ },
+ "auto_offline": {
+ "type": "boolean"
+ },
+ "custom_role_id": {
+ "type": "number",
+ "nullable": true
+ },
+ "custom_role": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "agent": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent computed by Chatwoot."
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away."
+ },
+ "confirmed": {
+ "type": "boolean",
+ "description": "Whether the agent has confirmed their email address."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the agent"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "The available name of the agent"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "The role of the agent"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent"
+ },
+ "custom_role_id": {
+ "type": "integer",
+ "description": "The custom role id of the agent"
+ }
+ }
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "Website URL"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "Widget Color used for customization of the widget"
+ },
+ "website_token": {
+ "type": "string",
+ "description": "Website Token"
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "The flag which shows whether Auto Assignment is enabled or not"
+ },
+ "web_widget_script": {
+ "type": "string",
+ "description": "Script used to load the website widget"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether greeting is enabled"
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "A greeting message when the user starts the conversation"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "ID of the channel this inbox belongs to"
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether working hours feature is enabled"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "The flag to enable collecting email from contacts"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "The flag to enable CSAT survey"
+ },
+ "auto_assignment_config": {
+ "type": "object",
+ "description": "Configuration settings for auto assignment"
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Message to show when agents are out of office"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "Configuration for working hours of the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "number",
+ "description": "Day of the week (0-6, where 0 is Sunday)"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is closed for the entire day"
+ },
+ "open_hour": {
+ "type": "number",
+ "description": "Hour when inbox opens (0-23)"
+ },
+ "open_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox opens (0-59)"
+ },
+ "close_hour": {
+ "type": "number",
+ "description": "Hour when inbox closes (0-23)"
+ },
+ "close_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox closes (0-59)"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is open for the entire day"
+ }
+ }
+ }
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone configuration for the inbox"
+ },
+ "callback_webhook_url": {
+ "type": "string",
+ "description": "Webhook URL for callbacks"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Whether to allow messages after a conversation is resolved"
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Whether to lock a contact to a single conversation"
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Type of sender name to display (e.g., friendly)"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name associated with the inbox"
+ },
+ "hmac_mandatory": {
+ "type": "boolean",
+ "description": "Whether HMAC verification is mandatory"
+ },
+ "selected_feature_flags": {
+ "type": "object",
+ "description": "Selected feature flags for the inbox"
+ },
+ "reply_time": {
+ "type": "string",
+ "description": "Expected reply time"
+ },
+ "messaging_service_sid": {
+ "type": "string",
+ "description": "Messaging service SID for SMS providers"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number associated with the inbox"
+ },
+ "medium": {
+ "type": "string",
+ "description": "Medium of communication (e.g., sms, email)"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the channel"
+ }
+ }
+ },
+ "inbox_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "The ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "provider": {
+ "type": "string",
+ "description": "The provider of the inbox"
+ }
+ }
+ },
+ "agent_bot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the agent bot"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the agent bot"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot"
+ },
+ "bot_type": {
+ "type": "string",
+ "description": "The type of the bot"
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration of the bot"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account ID if it's an account specific bot"
+ },
+ "access_token": {
+ "type": "string",
+ "description": "The access token for the bot"
+ },
+ "system_bot": {
+ "type": "boolean",
+ "description": "Whether the bot is a system bot"
+ }
+ }
+ },
+ "contact_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox_contact"
+ }
+ }
+ },
+ "contactable_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ },
+ "custom_filter": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the custom filter"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was updated"
+ }
+ }
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the webhook"
+ },
+ "url": {
+ "type": "string",
+ "description": "The url to which the events will be send"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "contact_created",
+ "contact_updated",
+ "message_created",
+ "message_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The list of subscribed events"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The id of the account which the webhook object belongs to"
+ }
+ }
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ],
+ "description": "The user role in the account"
+ }
+ }
+ },
+ "account_user": {
+ "type": "array",
+ "description": "Array of account users",
+ "items": {
"type": "object",
- "description": "A query that needs to be saved as a custom filter"
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
}
- }
- },
- "webhook_create_update_payload": {
- "type": "object",
- "properties": {
- "url": {
- "type": "string",
- "description": "The url where the events should be sent"
- },
- "subscriptions": {
- "type": "array",
- "items": {
+ },
+ "platform_account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ }
+ }
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account with the team is a part of"
+ },
+ "is_member": {
+ "type": "boolean",
+ "description": "This field shows whether the current user is a part of the team"
+ }
+ }
+ },
+ "integrations_app": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the integration"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "hook_type": {
+ "type": "string",
+ "description": "Whether the integration is an account or inbox integration"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the integration is enabled for the account"
+ },
+ "allow_multiple_hooks": {
+ "type": "boolean",
+ "description": "Whether multiple hooks can be created for the integration"
+ },
+ "hooks": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "If there are any hooks created for this integration"
+ }
+ }
+ },
+ "integrations_hook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration hook"
+ },
+ "app_id": {
+ "type": "string",
+ "description": "The ID of the integration app"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "Inbox ID if its an Inbox integration"
+ },
+ "account_id": {
+ "type": "string",
+ "description": "Account ID of the integration"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Whether the integration hook is enabled for the account"
+ },
+ "hook_type": {
+ "type": "boolean",
+ "description": "Whether its an account or inbox integration hook"
+ },
+ "settings": {
+ "type": "object",
+ "description": "The associated settings for the integration"
+ }
+ }
+ },
+ "public_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the contact"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The session identifier of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact"
+ },
+ "pubsub_token": {
+ "type": "string",
+ "description": "The token to be used to connect to chatwoot websocket"
+ }
+ }
+ },
+ "public_conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the conversation"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "The inbox id of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ },
+ "description": "Messages in the conversation"
+ },
+ "contact": {
+ "type": "object",
+ "description": "The contact information associated to the conversation"
+ }
+ }
+ },
+ "public_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Text content of the message"
+ },
+ "message_type": {
+ "type": "string",
+ "description": "Denotes the message type"
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Content type of the message"
+ },
+ "content_attributes": {
+ "type": "string",
+ "description": "Additional content attributes of the message"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Created at time stamp of the message"
+ },
+ "conversation_id": {
+ "type": "string",
+ "description": "Conversation Id of the message"
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "Attachments if any"
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender"
+ }
+ }
+ },
+ "public_inbox": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "Inbox identifier"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone defined on the inbox"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "The working hours defined on the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "integer",
+ "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is open the whole day"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is closed the whole day"
+ },
+ "open_hour": {
+ "type": "integer",
+ "description": "Opening hour. Can be null if closed all day"
+ },
+ "open_minutes": {
+ "type": "integer",
+ "description": "Opening minute. Can be null if closed all day"
+ },
+ "close_hour": {
+ "type": "integer",
+ "description": "Closing hour. Can be null if closed all day"
+ },
+ "close_minutes": {
+ "type": "integer",
+ "description": "Closing minute. Can be null if closed all day"
+ }
+ }
+ }
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the working hours are enabled on the inbox"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Greeting Message is enabled on the inbox"
+ },
+ "identity_validation_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the User Identity Validation is enforced on the inbox"
+ }
+ }
+ },
+ "account_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the account",
+ "example": "My Account"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the account",
+ "example": "en"
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain of the account",
+ "example": "example.com"
+ },
+ "support_email": {
+ "type": "string",
+ "description": "The support email of the account",
+ "example": "support@example.com"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "active",
+ "suspended"
+ ],
+ "description": "The status of the account",
+ "example": "active"
+ },
+ "limits": {
+ "type": "object",
+ "description": "The limits of the account",
+ "example": {}
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the account",
+ "example": {}
+ }
+ }
+ },
+ "account_user_create_update_payload": {
+ "type": "object",
+ "required": [
+ "user_id",
+ "role"
+ ],
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user",
+ "example": 1
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent",
+ "example": "administrator"
+ }
+ }
+ },
+ "platform_agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "The account ID to associate the agent bot with",
+ "example": 1
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ }
+ }
+ },
+ "agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "bot_type": {
+ "type": "integer",
+ "description": "The type of the bot (0 for webhook)",
+ "example": 0
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration for the bot",
+ "example": {}
+ }
+ }
+ },
+ "user_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the user",
+ "example": "Daniel"
+ },
+ "display_name": {
+ "type": "string",
+ "description": "Display name of the user",
+ "example": "Dan"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the user",
+ "example": "daniel@acme.inc"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password must contain uppercase, lowercase letters, number and a special character",
+ "example": "Password2!"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes you want to associate with the user",
+ "example": {}
+ }
+ }
+ },
+ "canned_response_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response",
+ "example": "Hello, {{contact.name}}! Welcome to our service."
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response",
+ "example": "welcome"
+ }
+ }
+ },
+ "custom_attribute_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name",
+ "example": "Custom Attribute"
+ },
+ "attribute_display_type": {
+ "type": "integer",
+ "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)",
+ "example": 0
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description",
+ "example": "This is a custom attribute"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value",
+ "example": "custom_attribute"
+ },
+ "attribute_values": {
+ "type": "array",
+ "description": "Attribute values",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "value1",
+ "value2"
+ ]
+ },
+ "attribute_model": {
+ "type": "integer",
+ "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)",
+ "example": 0
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).",
+ "example": "^[a-zA-Z0-9]+$"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.",
+ "example": "Please enter a valid value"
+ }
+ }
+ },
+ "agent_create_payload": {
+ "type": "object",
+ "required": [
+ "name",
+ "email",
+ "role"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Full Name of the agent",
+ "example": "John Doe"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the Agent",
+ "example": "john.doe@acme.inc"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability setting of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "agent_update_payload": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "contact_create_payload": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox to which the contact belongs",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "contact_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "conversation_create_payload": {
+ "type": "object",
+ "required": [
+ "source_id",
+ "inbox_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Conversation source id",
+ "example": "1234567890"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email",
+ "example": 1
+ },
+ "contact_id": {
+ "type": "integer",
+ "description": "Contact Id for which conversation is created",
+ "example": 1
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Lets you specify attributes like browser information",
+ "example": {
+ "browser": "Chrome",
+ "browser_version": "89.0.4389.82",
+ "os": "Windows",
+ "os_version": "10"
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
+ "example": {
+ "attribute_key": "attribute_value",
+ "priority_conversation_number": 3
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "Specify the conversation whether it's pending, open, closed",
+ "example": "open"
+ },
+ "assignee_id": {
+ "type": "integer",
+ "description": "Agent Id for assigning a conversation to an agent",
+ "example": 1
+ },
+ "team_id": {
+ "type": "integer",
+ "description": "Team Id for assigning a conversation to a team\\",
+ "example": 1
+ },
+ "snoozed_until": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Snoozed until date time",
+ "example": "2030-07-21T17:32:28Z"
+ },
+ "message": {
+ "type": "object",
+ "description": "The initial message to be sent to the conversation",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_message_create_payload": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "message_type": {
+ "type": "string",
+ "enum": [
+ "outgoing",
+ "incoming"
+ ],
+ "description": "The type of the message",
+ "example": "outgoing"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Flag to identify if it is a private note",
+ "example": false
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_email",
+ "cards",
+ "input_select",
+ "form",
+ "article"
+ ],
+ "description": "Content type of the message",
+ "example": "text"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes based on the content type",
+ "example": {}
+ },
+ "campaign_id": {
+ "type": "integer",
+ "description": "The campaign id to which the message belongs",
+ "example": 1
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ },
+ "inbox_create_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the channel",
+ "enum": [
+ "web_widget",
+ "api",
+ "email",
+ "line",
+ "telegram",
+ "whatsapp",
+ "sms"
+ ],
+ "example": "web_widget"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "inbox_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "team_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team",
+ "example": "Support Team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the team",
+ "example": "This is a team of support agents"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team",
+ "example": true
+ }
+ }
+ },
+ "custom_filter_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter",
+ "example": "My Custom Filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter",
+ "example": "conversation"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter",
+ "example": {}
+ }
+ }
+ },
+ "webhook_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The url where the events should be sent",
+ "example": "https://example.com/webhook"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "message_created",
+ "message_updated",
+ "contact_created",
+ "contact_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The events you want to subscribe to.",
+ "example": [
+ "conversation_created",
+ "conversation_status_changed"
+ ]
+ }
+ }
+ },
+ "integrations_hook_create_payload": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "integer",
+ "description": "The ID of app for which integration hook is being created",
+ "example": 1
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "The inbox ID, if the hook is an inbox hook",
+ "example": 1
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "integrations_hook_update_payload": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "automation_rule_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Rule name",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the automation and actions",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
"type": "string",
"enum": [
"conversation_created",
- "conversation_status_changed",
"conversation_updated",
- "message_created",
- "message_updated",
- "webwidget_triggered"
- ]
+ "message_created"
+ ],
+ "example": "message_created",
+ "description": "The event when you want to execute the automation actions"
},
- "description": "The events you want to subscribe to."
- }
- }
- },
- "integrations_hook_create_payload": {
- "type": "object",
- "properties": {
- "app_id": {
- "type": "string",
- "description": "The ID of app for which integration hook is being created"
- },
- "inbox_id": {
- "type": "string",
- "description": "The inbox ID, if the hook is an inbox hook"
- },
- "settings": {
- "type": "object",
- "description": "The settings required by the integration"
- }
- }
- },
- "integrations_hook_update_payload": {
- "type": "object",
- "properties": {
- "settings": {
- "type": "object",
- "description": "The settings required by the integration"
- }
- }
- },
- "automation_rule_create_update_payload": {
- "type": "object",
- "properties": {
- "name": {
- "type": "string",
- "description": "Rule name",
- "example": "Add label on message create event"
- },
- "description": {
- "type": "string",
- "description": "The description about the automation and actions",
- "example": "Add label support and sales on message create event if incoming message content contains text help"
- },
- "event_name": {
- "type": "string",
- "enum": [
- "conversation_created",
- "conversation_updated",
- "message_created"
- ],
- "example": "message_created",
- "description": "The event when you want to execute the automation actions"
- },
- "active": {
- "type": "boolean",
- "description": "Enable/disable automation rule"
- },
- "actions": {
- "type": "array",
- "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
- "items": {
- "type": "object",
- "example": {
- "action_name": "add_label",
- "action_params": [
- "support"
- ]
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support"
+ ]
+ }
}
- }
- },
- "conditions": {
- "type": "array",
- "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
- "items": {
- "type": "object",
- "example": {
- "attribute_key": "content",
- "filter_operator": "contains",
- "query_operator": "nil",
- "values": [
- "help"
- ]
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "query_operator": "OR",
+ "values": [
+ "help"
+ ]
+ }
}
}
}
- }
- },
- "portal_create_update_payload": {
- "type": "object",
- "properties": {
- "archived": {
- "type": "boolean",
- "description": "Status to check if portal is live"
- },
- "color": {
- "type": "string",
- "description": "Header color for help-center",
- "example": "add color HEX string, \"#fffff\""
- },
- "config": {
- "type": "object",
- "description": "Configuration about supporting locales",
- "example": {
- "allowed_locales": [
- "en",
- "es"
- ],
- "default_locale": "en"
- }
- },
- "custom_domain": {
- "type": "string",
- "description": "Custom domain to display help center.",
- "example": "https://chatwoot.help/."
- },
- "header_text": {
- "type": "string",
- "description": "Help center header",
- "example": "Handbook"
- },
- "homepage_link": {
- "type": "string",
- "description": "link to main dashboard",
- "example": "https://www.chatwoot.com/"
- },
- "name": {
- "type": "string",
- "description": "Name for the portal"
- },
- "slug": {
- "type": "string",
- "description": "Slug for the portal to display in link"
- },
- "page_title": {
- "type": "string",
- "description": "Page title for the portal"
- },
- "account_id": {
- "type": "integer"
- }
- }
- },
- "category_create_update_payload": {
- "type": "object",
- "properties": {
- "description": {
- "type": "string",
- "description": "Category description"
- },
- "locale": {
- "type": "string",
- "description": "Category locale",
- "example": "en/es"
- },
- "name": {
- "type": "string",
- "description": "Category name"
- },
- "slug": {
- "type": "string",
- "description": "Category slug"
- },
- "position": {
- "type": "integer",
- "description": "Category position in the portal list to sort"
- },
- "portal_id": {
- "type": "integer"
- },
- "account_id": {
- "type": "integer"
- },
- "associated_category_id": {
- "type": "integer",
- "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
- },
- "parent_category_id": {
- "type": "integer",
- "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
- }
- }
- },
- "article_create_update_payload": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string",
- "description": "The text content."
- },
- "meta": {
- "type": "object",
- "description": "Use for search",
- "example": {
- "tags": [
- "article_name"
- ],
- "title": "article title",
- "description": "article description"
- }
- },
- "position": {
- "type": "integer",
- "description": "article position in category"
- },
- "status": {
- "type": "integer",
- "example": [
- "draft",
- "published",
- "archived"
- ]
- },
- "title": {
- "type": "string"
- },
- "slug": {
- "type": "string"
- },
- "views": {
- "type": "integer"
- },
- "portal_id": {
- "type": "integer"
- },
- "account_id": {
- "type": "integer"
- },
- "author_id": {
- "type": "integer"
- },
- "category_id": {
- "type": "integer"
- },
- "folder_id": {
- "type": "integer"
- },
- "associated_article_id": {
- "type": "integer",
- "description": "To associate similar articles to each other, e.g to provide the link for the reference."
- }
- }
- },
- "public_contact_create_update_payload": {
- "type": "object",
- "properties": {
- "identifier": {
- "type": "string",
- "description": "External identifier of the contact"
- },
- "identifier_hash": {
- "type": "string",
- "description": "Identifier hash prepared for HMAC authentication"
- },
- "email": {
- "type": "string",
- "description": "Email of the contact"
- },
- "name": {
- "type": "string",
- "description": "Name of the contact"
- },
- "phone_number": {
- "type": "string",
- "description": "Phone number of the contact"
- },
- "avatar_url": {
- "type": "string",
- "description": "The url to a jpeg, png file for the user avatar"
- },
- "custom_attributes": {
- "type": "object",
- "description": "Custom attributes of the customer"
- }
- }
- },
- "public_message_create_payload": {
- "type": "object",
- "properties": {
- "content": {
- "type": "string",
- "description": "Content for the message"
- },
- "echo_id": {
- "type": "string",
- "description": "Temporary identifier which will be passed back via websockets"
- }
- }
- },
- "public_message_update_payload": {
- "type": "object",
- "properties": {
- "submitted_values": {
- "type": "object",
- "description": "Replies to the Bot Message Types"
- }
- }
- },
- "public_conversation_create_payload": {
- "type": "object",
- "properties": {
- "custom_attributes": {
- "type": "object",
- "description": "Custom attributes of the conversation"
- }
- }
- },
- "extended_contact": {
- "allOf": [
- {
- "$ref": "#/definitions/contact"
- },
- {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "Id of the user"
- },
- "availability_status": {
- "type": "string",
- "enum": [
- "online",
- "offline"
+ },
+ "portal_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string",
+ "description": "Header color for help-center in hex format",
+ "example": "#FFFFFF"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain to display help center.",
+ "example": "chatwoot.help"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "Help center header",
+ "example": "Handbook"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "link to main dashboard",
+ "example": "https://www.chatwoot.com/"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name for the portal",
+ "example": "Handbook"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal",
+ "example": "Handbook"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Slug for the portal to display in link",
+ "example": "handbook"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Status to check if portal is live",
+ "example": false
+ },
+ "config": {
+ "type": "object",
+ "description": "Configuration about supporting locales",
+ "example": {
+ "allowed_locales": [
+ "en",
+ "es"
],
- "description": "Availability status of the user"
+ "default_locale": "en"
}
}
}
- ]
- },
- "contact_base": {
- "allOf": [
- {
- "$ref": "#/definitions/generic_id"
- },
- {
- "$ref": "#/definitions/contact"
+ },
+ "category_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the category",
+ "example": "Category Name"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the category",
+ "example": "Category description"
+ },
+ "position": {
+ "type": "integer",
+ "description": "Category position in the portal list to sort",
+ "example": 1
+ },
+ "slug": {
+ "type": "string",
+ "description": "The category slug used in the URL",
+ "example": "category-name"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the category",
+ "example": "en"
+ },
+ "icon": {
+ "type": "string",
+ "description": "The icon of the category as a string (emoji)",
+ "example": "📚"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.",
+ "example": 1
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages",
+ "example": 2
+ }
}
- ]
- },
- "contact_list": {
- "type": "array",
- "description": "array of contacts",
- "items": {
+ },
+ "article_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the article",
+ "example": "Article Title"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the article",
+ "example": "article-title"
+ },
+ "position": {
+ "type": "integer",
+ "description": "article position in category",
+ "example": 1
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content.",
+ "example": "This is the content of the article"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the article",
+ "example": "This is the description of the article"
+ },
+ "category_id": {
+ "type": "integer",
+ "description": "The category id of the article",
+ "example": 1
+ },
+ "author_id": {
+ "type": "integer",
+ "description": "The author agent id of the article",
+ "example": 1
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference.",
+ "example": 2
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the article. 0 for draft, 1 for published, 2 for archived",
+ "example": 1
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the article",
+ "example": "en"
+ },
+ "meta": {
+ "type": "object",
+ "description": "Use for search",
+ "example": {
+ "tags": [
+ "article_name"
+ ],
+ "title": "article title",
+ "description": "article description"
+ }
+ }
+ }
+ },
+ "public_contact_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "External identifier of the contact",
+ "example": "1234567890"
+ },
+ "identifier_hash": {
+ "type": "string",
+ "description": "Identifier hash prepared for HMAC authentication",
+ "example": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact",
+ "example": "Alice"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the customer",
+ "example": {}
+ }
+ }
+ },
+ "public_message_create_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Content for the message",
+ "example": "Hello, how can I help you?"
+ },
+ "echo_id": {
+ "type": "string",
+ "description": "Temporary identifier which will be passed back via websockets",
+ "example": "1234567890"
+ }
+ }
+ },
+ "public_message_update_payload": {
+ "type": "object",
+ "properties": {
+ "submitted_values": {
+ "type": "object",
+ "description": "Replies to the Bot Message Types",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the submiitted value",
+ "example": "My Name"
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the submitted value",
+ "example": "My Title"
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the submitted value",
+ "example": "value"
+ },
+ "csat_survey_response": {
+ "type": "object",
+ "description": "The CSAT survey response",
+ "properties": {
+ "feedback_message": {
+ "type": "string",
+ "description": "The feedback message of the CSAT survey response",
+ "example": "Great service!"
+ },
+ "rating": {
+ "type": "integer",
+ "description": "The rating of the CSAT survey response",
+ "example": 5
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "public_conversation_create_payload": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the conversation",
+ "example": {}
+ }
+ }
+ },
+ "extended_contact": {
"allOf": [
{
- "$ref": "#/definitions/generic_id"
+ "$ref": "#/components/schemas/contact"
},
{
- "$ref": "#/definitions/contact"
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the user"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "online",
+ "offline"
+ ],
+ "description": "Availability status of the user"
+ }
+ }
}
]
- }
- },
- "contact_conversations": {
- "type": "array",
- "description": "array of conversations",
- "items": {
+ },
+ "contact_base": {
"allOf": [
{
- "$ref": "#/definitions/conversation"
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ },
+ "contact_list": {
+ "type": "array",
+ "description": "array of contacts",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ }
+ },
+ "contact_conversations": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "display_id": {
+ "type": "number"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "contact_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "conversation_list": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_show": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
},
{
"type": "object",
@@ -7114,6 +10640,18 @@
"sender": {
"type": "object",
"properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
"id": {
"type": "number",
"description": "ID fo the sender"
@@ -7122,440 +10660,1149 @@
"type": "string",
"description": "The name of the sender"
},
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
"thumbnail": {
"type": "string",
"description": "Avatar URL of the contact"
},
- "channel": {
- "type": "string",
- "description": "Channel Type"
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
}
}
},
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
"assignee": {
- "$ref": "#/definitions/user"
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "conversation_status_toggle": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object"
+ },
+ "payload": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "current_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved"
+ ]
+ },
+ "conversation_id": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "conversation_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "account_summary": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ },
+ "previous": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "agent_conversation_metrics": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "thumbnail": {
+ "type": "string"
+ },
+ "availability": {
+ "type": "string"
+ },
+ "metric": {
+ "type": "object",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "contact_detail": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of entity",
+ "enum": [
+ "contact"
+ ]
+ }
+ }
+ },
+ "message_detailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "description": "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form",
+ "input_csat"
+ ],
+ "description": "The type of the message content"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type",
+ "properties": {
+ "in_reply_to": {
+ "type": "string",
+ "description": "ID of the message this is replying to",
+ "nullable": true
+ }
+ }
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The timestamp when message was created"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flag which shows whether the message is private or not"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message",
+ "nullable": true
+ },
+ "sender": {
+ "$ref": "#/components/schemas/contact_detail"
+ }
+ }
+ },
+ "conversation_meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Labels associated with the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "object",
+ "properties": {
+ "device_name": {
+ "type": "string",
+ "description": "Name of the device"
+ },
+ "browser_name": {
+ "type": "string",
+ "description": "Name of the browser"
+ },
+ "platform_name": {
+ "type": "string",
+ "description": "Name of the platform"
+ },
+ "browser_version": {
+ "type": "string",
+ "description": "Version of the browser"
+ },
+ "platform_version": {
+ "type": "string",
+ "description": "Version of the platform"
+ }
+ }
+ },
+ "referer": {
+ "type": "string",
+ "description": "Referrer URL"
+ },
+ "initiated_at": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "description": "Timestamp when the conversation was initiated"
+ }
+ }
+ },
+ "browser_language": {
+ "type": "string",
+ "description": "Browser language setting"
+ },
+ "conversation_language": {
+ "type": "string",
+ "description": "Conversation language"
+ }
+ },
+ "description": "Additional attributes of the conversation"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact_detail"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the agent last saw the conversation",
+ "nullable": true
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the assignee last saw the conversation",
+ "nullable": true
+ }
+ }
+ },
+ "conversation_messages": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/conversation_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message_detailed"
+ },
+ "description": "List of messages in the conversation"
+ }
+ }
+ },
+ "contact_meta": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer",
+ "description": "Total number of contacts"
+ },
+ "current_page": {
+ "type": "string",
+ "description": "Current page number"
+ }
+ }
+ },
+ "contact_inbox": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source identifier for the contact inbox"
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL for the inbox avatar"
+ },
+ "channel_id": {
+ "type": "integer",
+ "description": "ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "Type of channel"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the inbox",
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "contact_list_item": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the contact",
+ "enum": [
+ "online",
+ "offline"
+ ]
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact",
+ "nullable": true
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity",
+ "nullable": true
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when contact was created"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "description": "List of inboxes associated with this contact",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ }
+ }
+ }
+ },
+ "contacts_list_response": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/contact_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_list_item"
+ },
+ "description": "List of contacts"
+ }
+ }
+ },
+ "contact_show_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/contact_list_item"
+ }
+ }
+ },
+ "contact_conversation_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Content of the message"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "integer",
+ "description": "ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "description": "Type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when message was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "Formatted datetime when message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Whether the message is private"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the message",
+ "nullable": true
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Type of the content"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes of the content"
+ },
+ "sender_type": {
+ "type": "string",
+ "description": "Type of the sender",
+ "nullable": true
+ },
+ "sender_id": {
+ "type": "integer",
+ "description": "ID of the sender",
+ "nullable": true
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "External source IDs"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "Processed message content",
+ "nullable": true
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "Sentiment analysis of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "Conversation details",
+ "properties": {
+ "assignee_id": {
+ "type": "integer",
+ "description": "ID of the assignee",
+ "nullable": true
+ },
+ "unread_count": {
+ "type": "integer",
+ "description": "Count of unread messages"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity"
+ },
+ "contact_inbox": {
+ "type": "object",
+ "description": "Contact inbox details",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the contact inbox"
}
}
}
}
},
- {
+ "sender": {
"type": "object",
+ "description": "Details of the sender",
"properties": {
- "display_id": {
- "type": "number"
+ "id": {
+ "type": "integer",
+ "description": "ID of the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the sender"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "Available name of the sender"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL of the sender's avatar"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Thumbnail URL of the sender"
}
}
}
- ]
- }
- },
- "contact_labels": {
- "type": "object",
- "properties": {
- "payload": {
- "type": "array",
- "description": "Array of labels",
- "items": {
- "type": "string"
- }
}
- }
- },
- "conversation_list": {
- "type": "object",
- "properties": {
- "data": {
- "type": "object",
- "properties": {
- "meta": {
- "type": "object",
- "properties": {
- "mine_count": {
- "type": "number"
+ },
+ "contact_conversations_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
},
- "unassigned_count": {
- "type": "number"
- },
- "assigned_count": {
- "type": "number"
- },
- "all_count": {
- "type": "number"
- }
- }
- },
- "payload": {
- "type": "array",
- "description": "array of conversations",
- "items": {
- "allOf": [
- {
- "$ref": "#/definitions/generic_id"
- },
- {
- "$ref": "#/definitions/conversation"
- },
- {
- "type": "object",
- "properties": {
- "meta": {
- "type": "object",
- "properties": {
- "sender": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID fo the sender"
- },
- "name": {
- "type": "string",
- "description": "The name of the sender"
- },
- "thumbnail": {
- "type": "string",
- "description": "Avatar URL of the contact"
- },
- "channel": {
- "type": "string",
- "description": "Channel Type"
- }
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
}
- },
- "assignee": {
- "$ref": "#/definitions/user"
}
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
}
}
}
}
- ]
- }
- }
- }
- }
- }
- },
- "conversation_show": {
- "type": "object",
- "allOf": [
- {
- "$ref": "#/definitions/conversation"
- },
- {
- "type": "object",
- "properties": {
- "meta": {
- "type": "object",
- "properties": {
- "sender": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number",
- "description": "ID fo the sender"
- },
- "name": {
- "type": "string",
- "description": "The name of the sender"
- },
- "thumbnail": {
- "type": "string",
- "description": "Avatar URL of the contact"
- },
- "channel": {
- "type": "string",
- "description": "Channel Type"
- }
- }
- },
- "assignee": {
- "$ref": "#/definitions/user"
}
- }
- }
- }
- }
- ]
- },
- "conversation_status_toggle": {
- "type": "object",
- "properties": {
- "meta": {
- "type": "object"
- },
- "payload": {
- "type": "object",
- "properties": {
- "success": {
- "type": "boolean"
- },
- "current_status": {
- "type": "string",
- "enum": [
- "open",
- "resolved"
]
},
- "conversation_id": {
- "type": "number"
- }
+ "description": "List of conversations for the contact"
+ }
+ }
+ },
+ "contactable_inboxes_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ },
+ "description": "List of contactable inboxes for the contact"
}
}
}
},
- "conversation_labels": {
- "type": "object",
- "properties": {
- "payload": {
- "type": "array",
- "description": "Array of labels",
- "items": {
- "type": "string"
- }
- }
+ "parameters": {
+ "account_id": {
+ "in": "path",
+ "name": "account_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the account"
+ },
+ "agent_bot_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agentbot to be updated"
+ },
+ "team_id": {
+ "in": "path",
+ "name": "team_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the team to be updated"
+ },
+ "inbox_id": {
+ "in": "path",
+ "name": "inbox_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the Inbox"
+ },
+ "hook_id": {
+ "in": "path",
+ "name": "hook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the integration hook"
+ },
+ "source_id": {
+ "in": "path",
+ "name": "source_id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ },
+ "contact_sort_param": {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "name",
+ "email",
+ "phone_number",
+ "last_activity_at",
+ "-name",
+ "-email",
+ "-phone_number",
+ "-last_activity_at"
+ ]
+ },
+ "required": false,
+ "description": "The attribute by which list should be sorted"
+ },
+ "conversation_id": {
+ "in": "path",
+ "name": "conversation_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the conversation"
+ },
+ "conversation_uuid": {
+ "in": "path",
+ "name": "conversation_uuid",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The uuid of the conversation"
+ },
+ "custom_filter_id": {
+ "in": "path",
+ "name": "custom_filter_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the custom filter"
+ },
+ "webhook_id": {
+ "in": "path",
+ "name": "webhook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the webhook"
+ },
+ "message_id": {
+ "in": "path",
+ "name": "message_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the message"
+ },
+ "page": {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": false,
+ "description": "The page parameter"
+ },
+ "platform_user_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the user on the platform"
+ },
+ "report_type": {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account",
+ "agent",
+ "inbox",
+ "label",
+ "team"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ "report_metric": {
+ "in": "query",
+ "name": "metric",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversations_count",
+ "incoming_messages_count",
+ "outgoing_messages_count",
+ "avg_first_response_time",
+ "avg_resolution_time",
+ "resolutions_count"
+ ]
+ },
+ "required": true,
+ "description": "The type of metric"
+ },
+ "public_inbox_identifier": {
+ "in": "path",
+ "name": "inbox_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The identifier obtained from API inbox channel"
+ },
+ "public_contact_identifier": {
+ "in": "path",
+ "name": "contact_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The source id of contact obtained on contact create"
+ },
+ "portal_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The slug identifier of the portal"
}
},
- "account_summary": {
- "type": "object",
- "properties": {
- "avg_first_response_time": {
- "type": "string"
- },
- "avg_resolution_time": {
- "type": "string"
- },
- "conversations_count": {
- "type": "number"
- },
- "incoming_messages_count": {
- "type": "number"
- },
- "outgoing_messages_count": {
- "type": "number"
- },
- "resolutions_count": {
- "type": "number"
- },
- "previous": {
- "type": "object",
- "properties": {
- "avg_first_response_time": {
- "type": "string"
- },
- "avg_resolution_time": {
- "type": "string"
- },
- "conversations_count": {
- "type": "number"
- },
- "incoming_messages_count": {
- "type": "number"
- },
- "outgoing_messages_count": {
- "type": "number"
- },
- "resolutions_count": {
- "type": "number"
- }
- }
- }
- }
- },
- "agent_conversation_metrics": {
- "type": "object",
- "properties": {
- "id": {
- "type": "number"
- },
- "name": {
- "type": "string"
- },
- "email": {
- "type": "string"
- },
- "thumbnail": {
- "type": "string"
- },
- "availability": {
- "type": "string"
- },
- "metric": {
- "type": "object",
- "properties": {
- "open": {
- "type": "number"
- },
- "unattended": {
- "type": "number"
- }
- }
- }
+ "securitySchemes": {
+ "userApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
+ },
+ "agentBotApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
+ },
+ "platformAppApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
}
}
},
- "parameters": {
- "account_id": {
- "in": "path",
- "name": "account_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the account"
+ "tags": [
+ {
+ "name": "Accounts",
+ "description": "Account management APIs"
},
- "agent_bot_id": {
- "in": "path",
- "name": "id",
- "type": "integer",
- "required": true,
- "description": "The ID of the agentbot to be updated"
+ {
+ "name": "Account Users",
+ "description": "Account user management APIs"
},
- "team_id": {
- "in": "path",
- "name": "team_id",
- "type": "integer",
- "required": true,
- "description": "The ID of the team to be updated"
+ {
+ "name": "AgentBots",
+ "description": "Bot integrations"
},
- "inbox_id": {
- "in": "path",
- "name": "inbox_id",
- "type": "integer",
- "required": true,
- "description": "The ID of the Inbox"
+ {
+ "name": "Users",
+ "description": "User management APIs"
},
- "hook_id": {
- "in": "path",
- "name": "hook_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the integration hook"
+ {
+ "name": "Account AgentBots",
+ "description": "Account-specific Agent Bots"
},
- "source_id": {
- "in": "path",
- "name": "source_id",
- "required": true,
- "type": "string",
- "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ {
+ "name": "Agents",
+ "description": "Agent management APIs"
},
- "contact_sort_param": {
- "in": "query",
- "name": "sort",
- "type": "string",
- "enum": [
- "name",
- "email",
- "phone_number",
- "last_activity_at",
- "-name",
- "-email",
- "-phone_number",
- "-last_activity_at"
- ],
- "required": false,
- "description": "The attribute by which list should be sorted"
+ {
+ "name": "Canned Responses",
+ "description": "Pre-defined responses for common queries"
},
- "conversation_id": {
- "in": "path",
- "name": "conversation_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the conversation"
+ {
+ "name": "Contacts",
+ "description": "Contact management APIs"
},
- "conversation_uuid": {
- "in": "path",
- "name": "conversation_uuid",
- "type": "integer",
- "required": true,
- "description": "The uuid of the conversation"
+ {
+ "name": "Contact Labels",
+ "description": "Manage contact labels"
},
- "custom_filter_id": {
- "in": "path",
- "name": "custom_filter_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the custom filter"
+ {
+ "name": "Conversation Assignments",
+ "description": "Manage conversation assignments"
},
- "webhook_id": {
- "in": "path",
- "name": "webhook_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the webhook"
+ {
+ "name": "Conversation Labels",
+ "description": "Manage conversation labels"
},
- "message_id": {
- "in": "path",
- "name": "message_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the message"
+ {
+ "name": "Conversations",
+ "description": "Conversation management APIs"
},
- "page": {
- "in": "query",
- "name": "page",
- "type": "integer",
- "default": 1,
- "required": false,
- "description": "The page parameter"
+ {
+ "name": "Custom Attributes",
+ "description": "Custom fields for contacts and conversations"
},
- "platform_user_id": {
- "in": "path",
- "name": "id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the user on the platform"
+ {
+ "name": "Custom Filters",
+ "description": "Saved filters for conversations"
},
- "report_type": {
- "in": "query",
- "name": "type",
- "type": "string",
- "enum": [
- "account",
- "agent",
- "inbox",
- "label",
- "team"
- ],
- "required": true,
- "description": "Type of report"
+ {
+ "name": "Inboxes",
+ "description": "Communication channels setup"
},
- "report_metric": {
- "in": "query",
- "name": "metric",
- "type": "string",
- "enum": [
- "conversations_count",
- "incoming_messages_count",
- "outgoing_messages_count",
- "avg_first_response_time",
- "avg_resolution_time",
- "resolutions_count"
- ],
- "required": true,
- "description": "The type of metric"
+ {
+ "name": "Integrations",
+ "description": "Third-party integrations"
},
- "public_inbox_identifier": {
- "in": "path",
- "name": "inbox_identifier",
- "type": "string",
- "required": true,
- "description": "The identifier obtained from API inbox channel"
+ {
+ "name": "Messages",
+ "description": "Message management APIs"
},
- "public_contact_identifier": {
- "in": "path",
- "name": "contact_identifier",
- "type": "string",
- "required": true,
- "description": "The source id of contact obtained on contact create"
+ {
+ "name": "Profile",
+ "description": "User profile APIs"
},
- "portal_id": {
- "in": "path",
- "name": "portal_id",
- "type": "integer",
- "required": true,
- "description": "The numeric ID of the portal"
+ {
+ "name": "Reports",
+ "description": "Analytics and reporting APIs"
+ },
+ {
+ "name": "Teams",
+ "description": "Team management APIs"
+ },
+ {
+ "name": "Webhooks",
+ "description": "Event notification webhooks"
+ },
+ {
+ "name": "Automation Rule",
+ "description": "Workflow automation rules"
+ },
+ {
+ "name": "Help Center",
+ "description": "Knowledge base management"
+ },
+ {
+ "name": "Contacts API",
+ "description": "Public contact APIs"
+ },
+ {
+ "name": "Conversations API",
+ "description": "Public conversation APIs"
+ },
+ {
+ "name": "Messages API",
+ "description": "Public message APIs"
+ },
+ {
+ "name": "CSAT Survey Page",
+ "description": "Customer satisfaction survey"
}
- },
+ ],
"x-tagGroups": [
{
"name": "Platform",
@@ -7574,7 +11821,7 @@
"Canned Responses",
"Contacts",
"Contact Labels",
- "Conversation Assignment",
+ "Conversation Assignments",
"Conversation Labels",
"Conversations",
"Custom Attributes",
diff --git a/swagger/tag_groups/application.yml b/swagger/tag_groups/application.yml
new file mode 100644
index 000000000..85d96c5b7
--- /dev/null
+++ b/swagger/tag_groups/application.yml
@@ -0,0 +1,65 @@
+openapi: '3.0.4'
+info:
+ title: Chatwoot - Application API
+ description: Application API endpoints for Chatwoot
+ version: 1.1.0
+ termsOfService: https://www.chatwoot.com/terms-of-service/
+ contact:
+ email: hello@chatwoot.com
+ license:
+ name: MIT License
+ url: https://opensource.org/licenses/MIT
+servers:
+ - url: https://app.chatwoot.com/
+tags:
+ - name: Account AgentBots
+ description: Manage agent bots within accounts
+ - name: Agents
+ description: Manage agents
+ - name: Canned Responses
+ description: Manage canned responses
+ - name: Contacts
+ description: Manage contacts
+ - name: Contact Labels
+ description: Manage contact labels
+ - name: Conversation Assignments
+ description: Manage conversation assignments
+ - name: Conversation Labels
+ description: Manage conversation labels
+ - name: Conversations
+ description: Manage conversations
+ - name: Custom Attributes
+ description: Manage custom attributes
+ - name: Custom Filters
+ description: Manage custom filters
+ - name: Inboxes
+ description: Manage inboxes
+ - name: Integrations
+ description: Manage integrations
+ - name: Messages
+ description: Manage messages
+ - name: Profile
+ description: Manage user profile
+ - name: Reports
+ description: Generate reports
+ - name: Teams
+ description: Manage teams
+ - name: Webhooks
+ description: Manage webhooks
+ - name: Automation Rule
+ description: Manage automation rules
+ - name: Help Center
+ description: Manage help center
+paths:
+ $ref: ../paths/index.yml
+components:
+ schemas:
+ $ref: ../definitions/index.yml
+ parameters:
+ $ref: ../parameters/index.yml
+ securitySchemes:
+ userApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
\ No newline at end of file
diff --git a/swagger/tag_groups/application_swagger.json b/swagger/tag_groups/application_swagger.json
new file mode 100644
index 000000000..33e75183f
--- /dev/null
+++ b/swagger/tag_groups/application_swagger.json
@@ -0,0 +1,10184 @@
+{
+ "openapi": "3.0.4",
+ "info": {
+ "title": "Chatwoot",
+ "description": "This is the API documentation for Chatwoot server.",
+ "version": "1.1.0",
+ "termsOfService": "https://www.chatwoot.com/terms-of-service/",
+ "contact": {
+ "email": "hello@chatwoot.com"
+ },
+ "license": {
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://app.chatwoot.com/"
+ }
+ ],
+ "paths": {
+ "/api/v1/accounts/{account_id}/agent_bots": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Account AgentBots"
+ ],
+ "operationId": "list-all-account-agent-bots",
+ "summary": "List all AgentBots",
+ "description": "List all agent bots available for the current account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent bots",
+ "items": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Account AgentBots"
+ ],
+ "operationId": "create-an-account-agent-bot",
+ "summary": "Create an Agent Bot",
+ "description": "Create an agent bot in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/agent_bots/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/agent_bot_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Account AgentBots"
+ ],
+ "operationId": "get-details-of-a-single-account-agent-bot",
+ "summary": "Get an agent bot details",
+ "description": "Get the details of an agent bot in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given agent bot ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Account AgentBots"
+ ],
+ "operationId": "update-an-account-agent-bot",
+ "summary": "Update an agent bot",
+ "description": "Update an agent bot's attributes",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Account AgentBots"
+ ],
+ "operationId": "delete-an-account-agent-bot",
+ "summary": "Delete an AgentBot",
+ "description": "Delete an AgentBot from the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The agent bot does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/agents": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Agents"
+ ],
+ "operationId": "get-account-agents",
+ "summary": "List Agents in Account",
+ "description": "Get Details of Agents in an Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Agents"
+ ],
+ "operationId": "add-new-agent-to-account",
+ "summary": "Add a New Agent",
+ "description": "Add a new Agent to Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/agents/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Agents"
+ ],
+ "operationId": "update-agent-in-account",
+ "summary": "Update Agent in Account",
+ "description": "Update an Agent in Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agent to be updated."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Agents"
+ ],
+ "operationId": "delete-agent-from-account",
+ "summary": "Remove an Agent from Account",
+ "description": "Remove an Agent from Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agent to be deleted."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "404": {
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/canned_responses": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Canned Responses"
+ ],
+ "operationId": "get-account-canned-response",
+ "summary": "List all Canned Responses in an Account",
+ "description": "Get Details of Canned Responses in an Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all canned responses",
+ "items": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Canned Responses"
+ ],
+ "operationId": "add-new-canned-response-to-account",
+ "summary": "Add a New Canned Response",
+ "description": "Add a new Canned Response to Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/canned_responses/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Canned Responses"
+ ],
+ "operationId": "update-canned-response-in-account",
+ "summary": "Update Canned Response in Account",
+ "description": "Update a Canned Response in Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the canned response to be updated."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/canned_response"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Canned Responses"
+ ],
+ "operationId": "delete-canned-response-from-account",
+ "summary": "Remove a Canned Response from Account",
+ "description": "Remove a Canned Response from Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the canned response to be deleted"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "404": {
+ "description": "Canned Response not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/custom_attribute_definitions": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Custom Attributes"
+ ],
+ "operationId": "get-account-custom-attribute",
+ "summary": "List all custom attributes in an account",
+ "parameters": [
+ {
+ "name": "attribute_model",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "0",
+ "1"
+ ]
+ },
+ "description": "conversation_attribute(0)/contact_attribute(1)",
+ "required": true
+ }
+ ],
+ "description": "Get details of custom attributes in an Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all custom attributes",
+ "items": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Custom Attributes"
+ ],
+ "operationId": "add-new-custom-attribute-to-account",
+ "summary": "Add a new custom attribute",
+ "description": "Add a new custom attribute to account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the custom attribute",
+ "required": true
+ }
+ ],
+ "get": {
+ "tags": [
+ "Custom Attributes"
+ ],
+ "operationId": "get-details-of-a-single-custom-attribute",
+ "summary": "Get a custom attribute details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get the details of a custom attribute in the account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the custom attribute to be updated."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given attribute ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Custom Attributes"
+ ],
+ "operationId": "update-custom-attribute-in-account",
+ "summary": "Update custom attribute in Account",
+ "description": "Update a custom attribute in account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the custom attribute to be updated."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_attribute"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Agent not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Custom Attributes"
+ ],
+ "operationId": "delete-custom-attribute-from-account",
+ "summary": "Remove a custom attribute from account",
+ "description": "Remove a custom attribute from account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the custom attribute to be deleted"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "404": {
+ "description": "Custom attribute not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts": {
+ "get": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactList",
+ "description": "Listing all the resolved contacts with pagination (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number",
+ "summary": "List Contacts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/contact_sort_param"
+ },
+ {
+ "$ref": "#/components/parameters/page"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactCreate",
+ "description": "Create a new Contact",
+ "summary": "Create Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/extended_contact"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactDetails",
+ "summary": "Show Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get a contact belonging to the account using ID",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_show_response"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactUpdate",
+ "summary": "Update Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update a contact belonging to the account using ID",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_base"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactDelete",
+ "summary": "Delete Contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a contact belonging to the account using ID",
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/{id}/conversations": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactConversations",
+ "summary": "Contact Conversations",
+ "description": "Get conversations associated with that contact",
+ "parameters": [
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_conversations_response"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/{id}/labels": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "required": true,
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the contact"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Contact Labels"
+ ],
+ "operationId": "list-all-labels-of-a-contact",
+ "summary": "List Labels",
+ "description": "Lists all the labels of a contact",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_labels"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Contact Labels"
+ ],
+ "operationId": "contact-add-labels",
+ "summary": "Add Labels",
+ "description": "Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "labels"
+ ],
+ "properties": {
+ "labels": {
+ "type": "array",
+ "description": "Array of labels (comma-separated strings)",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "support",
+ "billing"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contact_labels"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Contact not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/search": {
+ "get": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactSearch",
+ "description": "Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number",
+ "summary": "Search Contacts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "q",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Search using contact `name`, `identifier`, `email` or `phone number`"
+ },
+ {
+ "$ref": "#/components/parameters/contact_sort_param"
+ },
+ {
+ "$ref": "#/components/parameters/page"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Authentication error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/contacts/filter": {
+ "post": {
+ "tags": [
+ "Contacts"
+ ],
+ "operationId": "contactFilter",
+ "description": "Filter contacts with custom filter options and pagination",
+ "summary": "Contact Filter",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "page",
+ "in": "query",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attribute_key": {
+ "type": "string",
+ "description": "filter attribute name"
+ },
+ "filter_operator": {
+ "type": "string",
+ "description": "filter operator name",
+ "enum": [
+ "equal_to",
+ "not_equal_to",
+ "contains",
+ "does_not_contain"
+ ]
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "array of the attribute values to filter"
+ },
+ "query_operator": {
+ "type": "string",
+ "description": "query operator name",
+ "enum": [
+ "AND",
+ "OR"
+ ]
+ }
+ }
+ },
+ "example": [
+ {
+ "attribute_key": "name",
+ "filter_operator": "equal_to",
+ "values": [
+ "en"
+ ],
+ "query_operator": "AND"
+ },
+ {
+ "attribute_key": "country_code",
+ "filter_operator": "equal_to",
+ "values": [
+ "us"
+ ],
+ "query_operator": null
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/contacts_list_response"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/automation_rules": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Automation Rule"
+ ],
+ "operationId": "get-account-automation-rule",
+ "summary": "List all automation rules in an account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/page"
+ }
+ ],
+ "description": "Get details of automation rules in an Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Automation Rule"
+ ],
+ "operationId": "add-new-automation-rule-to-account",
+ "summary": "Add a new automation rule",
+ "description": "Add a new automation rule to account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/automation_rules/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the Automation Rule",
+ "required": true
+ }
+ ],
+ "get": {
+ "tags": [
+ "Automation Rule"
+ ],
+ "operationId": "get-details-of-a-single-automation-rule",
+ "summary": "Get a automation rule details",
+ "description": "Get the details of a automation rule in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the automation rule to be updated."
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ },
+ "example": {
+ "payload": {
+ "id": 90,
+ "account_id": 1,
+ "name": "add-label-bug-if-message-contains-bug",
+ "description": "add-label-bug-if-message-contains-bug",
+ "event_name": "message_created",
+ "conditions": [
+ {
+ "values": [
+ "incoming"
+ ],
+ "attribute_key": "message_type",
+ "query_operator": "and",
+ "filter_operator": "equal_to"
+ },
+ {
+ "values": [
+ "bug"
+ ],
+ "attribute_key": "content",
+ "filter_operator": "contains"
+ }
+ ],
+ "actions": [
+ {
+ "action_name": "add_label",
+ "action_params": [
+ "bugs",
+ "support-query"
+ ]
+ }
+ ],
+ "created_on": 1650555440,
+ "active": true
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given rule ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Automation Rule"
+ ],
+ "operationId": "update-automation-rule-in-account",
+ "summary": "Update automation rule in Account",
+ "description": "Update a automation rule in account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the automation rule to be updated."
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/automation_rule"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Rule not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Automation Rule"
+ ],
+ "operationId": "delete-automation-rule-from-account",
+ "summary": "Remove a automation rule from account",
+ "description": "Remove a automation rule from account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the automation rule to be deleted"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "automation rule not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/portals": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "add-new-portal-to-account",
+ "summary": "Add a new portal",
+ "description": "Add a new portal to account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "get-portal",
+ "summary": "List all portals in an account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "description": "Get details of portals in an Account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal"
+ },
+ "example": {
+ "payload": [
+ {
+ "id": 4,
+ "color": "#1F93FF",
+ "custom_domain": "chatwoot.help",
+ "header_text": "Handbook",
+ "homepage_link": "https://www.chatwoot.com",
+ "name": "Handbook",
+ "page_title": "Handbook",
+ "slug": "handbook",
+ "archived": false,
+ "account_id": 1,
+ "config": {
+ "allowed_locales": [
+ {
+ "code": "en",
+ "articles_count": 32,
+ "categories_count": 9
+ }
+ ]
+ },
+ "inbox": {
+ "id": 37,
+ "avatar_url": "https://example.com/avatar.png",
+ "channel_id": 1,
+ "name": "Chatwoot",
+ "channel_type": "Channel::WebWidget",
+ "greeting_enabled": true,
+ "widget_color": "#1F93FF",
+ "website_url": "chatwoot.com"
+ },
+ "logo": {
+ "id": 19399916,
+ "portal_id": 4,
+ "file_type": "image/png",
+ "account_id": 1,
+ "file_url": "https://example.com/logo.png",
+ "blob_id": 21239614,
+ "filename": "square.png"
+ },
+ "meta": {
+ "all_articles_count": 0,
+ "categories_count": 9,
+ "default_locale": "en"
+ }
+ }
+ ]
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/portals/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "update-portal-to-account",
+ "summary": "Update a portal",
+ "description": "Update a portal to account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/portal_single"
+ },
+ "example": {
+ "payload": {
+ "id": 123,
+ "archived": false,
+ "color": "#1F93FF",
+ "config": {
+ "allowed_locales": [
+ {
+ "code": "en",
+ "articles_count": 32,
+ "categories_count": 9
+ }
+ ]
+ },
+ "custom_domain": "chatwoot.help",
+ "header_text": "Handbook",
+ "homepage_link": "https://www.chatwoot.com",
+ "name": "Handbook",
+ "slug": "handbook",
+ "page_title": "Handbook",
+ "account_id": 123,
+ "inbox": {
+ "id": 123,
+ "name": "Chatwoot",
+ "website_url": "chatwoot.com",
+ "channel_type": "Channel::WebWidget",
+ "avatar_url": "https://example.com/avatar.png",
+ "widget_color": "#1F93FF",
+ "website_token": "4cWzuf9i9jxN9tbnv8K9STKU",
+ "enable_auto_assignment": true,
+ "web_widget_script": "",
+ "welcome_title": "Hi there ! 🙌🏼",
+ "welcome_tagline": "We make it simple to connect with us.",
+ "greeting_enabled": true,
+ "greeting_message": "Hey there 👋, Thank you for reaching out to us.",
+ "channel_id": 123,
+ "working_hours_enabled": true,
+ "enable_email_collect": true,
+ "csat_survey_enabled": true,
+ "timezone": "America/Los_Angeles",
+ "business_name": "Chatwoot",
+ "hmac_mandatory": true
+ },
+ "logo": {
+ "id": 123,
+ "portal_id": 123,
+ "file_type": "image/png",
+ "account_id": 123,
+ "file_url": "https://example.com/logo.png",
+ "blob_id": 123,
+ "filename": "square.png"
+ },
+ "meta": {
+ "all_articles_count": 32,
+ "categories_count": 9,
+ "default_locale": "en"
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Portal not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/portals/{id}/categories": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "add-new-category-to-account",
+ "summary": "Add a new category",
+ "description": "Add a new category to portal",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/category_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/category"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/portals/{id}/articles": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Help Center"
+ ],
+ "operationId": "add-new-article-to-account",
+ "summary": "Add a new article",
+ "description": "Add a new article to portal",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/article_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/article"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/meta": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "conversationListMeta",
+ "description": "Get open, unassigned and all Conversation counts",
+ "summary": "Get Conversation Counts",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "status",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "all",
+ "open",
+ "resolved",
+ "pending",
+ "snoozed"
+ ],
+ "default": "open"
+ },
+ "description": "Filter by conversation status."
+ },
+ {
+ "name": "q",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Filters conversations with messages containing the search term"
+ },
+ {
+ "name": "inbox_id",
+ "in": "query",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "team_id",
+ "in": "query",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "labels",
+ "in": "query",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "conversationList",
+ "description": "List all the conversations with pagination",
+ "summary": "Conversations List",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "assignee_type",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "me",
+ "unassigned",
+ "all",
+ "assigned"
+ ],
+ "default": "all"
+ },
+ "description": "Filter conversations by assignee type."
+ },
+ {
+ "name": "status",
+ "in": "query",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "all",
+ "open",
+ "resolved",
+ "pending",
+ "snoozed"
+ ],
+ "default": "open"
+ },
+ "description": "Filter by conversation status."
+ },
+ {
+ "name": "q",
+ "in": "query",
+ "schema": {
+ "type": "string"
+ },
+ "description": "Filters conversations with messages containing the search term"
+ },
+ {
+ "name": "inbox_id",
+ "in": "query",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "team_id",
+ "in": "query",
+ "schema": {
+ "type": "integer"
+ }
+ },
+ {
+ "name": "labels",
+ "in": "query",
+ "schema": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ {
+ "name": "page",
+ "in": "query",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "description": "paginate through conversations"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_list"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "newConversation",
+ "summary": "Create New Conversation",
+ "description": "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://www.chatwoot.com/hc/user-guide/articles/1677839703-how-to-create-an-api-channel-inbox#send-messages-to-the-api-channel",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ }
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/filter": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "conversationFilter",
+ "description": "Filter conversations with custom filter options and pagination",
+ "summary": "Conversations Filter",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "name": "page",
+ "in": "query",
+ "schema": {
+ "type": "number"
+ }
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "attribute_key": {
+ "type": "string",
+ "description": "filter attribute name"
+ },
+ "filter_operator": {
+ "type": "string",
+ "description": "filter operator name",
+ "enum": [
+ "equal_to",
+ "not_equal_to",
+ "contains",
+ "does_not_contain"
+ ]
+ },
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "array of the attribute values to filter"
+ },
+ "query_operator": {
+ "type": "string",
+ "description": "query operator name",
+ "enum": [
+ "AND",
+ "OR"
+ ]
+ }
+ }
+ },
+ "example": [
+ {
+ "attribute_key": "browser_language",
+ "filter_operator": "not_equal_to",
+ "values": [
+ "en"
+ ],
+ "query_operator": "AND"
+ },
+ {
+ "attribute_key": "status",
+ "filter_operator": "equal_to",
+ "values": [
+ "pending"
+ ],
+ "query_operator": null
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_list"
+ }
+ }
+ }
+ },
+ "400": {
+ "description": "Bad Request Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "get-details-of-a-conversation",
+ "summary": "Conversation Details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get all details regarding a conversation with all messages in the conversation",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_show"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "update-conversation",
+ "summary": "Update Conversation",
+ "description": "Update Conversation Attributes",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "priority": {
+ "type": "string",
+ "enum": [
+ "urgent",
+ "high",
+ "medium",
+ "low",
+ "none"
+ ],
+ "description": "The priority of the conversation",
+ "example": "high"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy (Available only in Enterprise edition)",
+ "example": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "toggle-status-of-a-conversation",
+ "summary": "Toggle Status",
+ "description": "Toggles the status of the conversation between open and resolved",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "status"
+ ],
+ "properties": {
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation",
+ "example": "open"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_status_toggle"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_priority": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "toggle-priority-of-a-conversation",
+ "summary": "Toggle Priority",
+ "description": "Toggles the priority of conversation",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "priority"
+ ],
+ "properties": {
+ "priority": {
+ "type": "string",
+ "enum": [
+ "urgent",
+ "high",
+ "medium",
+ "low",
+ "none"
+ ],
+ "description": "The priority of the conversation",
+ "example": "high"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "update-custom-attributes-of-a-conversation",
+ "summary": "Update Custom Attributes",
+ "description": "Updates the custom attributes of a conversation",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "custom_attributes"
+ ],
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes to be set for the conversation",
+ "example": {
+ "order_id": "12345",
+ "previous_conversation": "67890"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the conversation"
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversation Assignments"
+ ],
+ "operationId": "assign-a-conversation",
+ "summary": "Assign Conversation",
+ "description": "Assign a conversation to an agent or a team",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "assignee_id": {
+ "type": "number",
+ "description": "Id of the assignee user",
+ "example": 1
+ },
+ "team_id": {
+ "type": "number",
+ "description": "Id of the team. If the assignee_id is present, this param would be ignored",
+ "example": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "list-all-labels-of-a-conversation",
+ "summary": "List Labels",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Lists all the labels of a conversation",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_labels"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Conversations"
+ ],
+ "operationId": "conversation-add-labels",
+ "summary": "Add Labels",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "labels"
+ ],
+ "properties": {
+ "labels": {
+ "type": "array",
+ "description": "Array of labels (comma-separated strings)",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "support",
+ "billing"
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_labels"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes": {
+ "get": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "listAllInboxes",
+ "summary": "List all inboxes",
+ "description": "List all inboxes available in the current account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of inboxes",
+ "items": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes/{id}/": {
+ "get": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "GetInbox",
+ "summary": "Get an inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get an inbox available in the current account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the inbox",
+ "required": true
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes/": {
+ "post": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "inboxCreation",
+ "summary": "Create an inbox",
+ "description": "You can create more than one website inbox in each account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes/{id}": {
+ "patch": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "updateInbox",
+ "summary": "Update Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update an existing inbox",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the inbox",
+ "required": true
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes/{id}/agent_bot": {
+ "get": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "getInboxAgentBot",
+ "summary": "Show Inbox Agent Bot",
+ "description": "See if an agent bot is associated to the Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the inbox",
+ "required": true
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found, Agent bot not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inboxes/{id}/set_agent_bot": {
+ "post": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "updateAgentBot",
+ "summary": "Add or remove agent bot",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "name": "id",
+ "in": "path",
+ "schema": {
+ "type": "number"
+ },
+ "description": "ID of the inbox",
+ "required": true
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "agent_bot"
+ ],
+ "properties": {
+ "agent_bot": {
+ "type": "number",
+ "description": "Agent bot ID",
+ "example": 1
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "204": {
+ "description": "Success"
+ },
+ "404": {
+ "description": "Inbox not found, Agent bot not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inbox_members/{inbox_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/inbox_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "get-inbox-members",
+ "summary": "List Agents in Inbox",
+ "description": "Get Details of Agents in an Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/inbox_id"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/inbox_members": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "add-new-agent-to-inbox",
+ "summary": "Add a New Agent",
+ "description": "Add a new Agent to Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "integer",
+ "description": "The ID of the inbox",
+ "example": 1
+ },
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the inbox",
+ "example": [
+ 1
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "update-agents-in-inbox",
+ "summary": "Update Agents in Inbox",
+ "description": "All agents except the one passed in params will be removed",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "string",
+ "description": "The ID of the inbox",
+ "example": 1
+ },
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the inbox",
+ "example": [
+ 1
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Inboxes"
+ ],
+ "operationId": "delete-agent-in-inbox",
+ "summary": "Remove an Agent from Inbox",
+ "description": "Remove an Agent from Inbox",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "inbox_id",
+ "user_ids"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "string",
+ "description": "The ID of the inbox"
+ },
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be deleted from the inbox"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "404": {
+ "description": "Inbox not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Messages"
+ ],
+ "operationId": "list-all-messages",
+ "summary": "Get messages",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "List all messages of a conversation",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "additional_attributes": {
+ "type": "object"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/agent"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "format": "date-time"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "Array of messages",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Messages"
+ ],
+ "operationId": "create-a-new-message-in-a-conversation",
+ "summary": "Create New Message",
+ "description": "Create a new message in the conversation",
+ "security": [
+ {
+ "userApiKey": []
+ },
+ {
+ "agentBotApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/conversation_message_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/message"
+ }
+ ]
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ },
+ {
+ "$ref": "#/components/parameters/message_id"
+ }
+ ],
+ "delete": {
+ "tags": [
+ "Messages"
+ ],
+ "operationId": "delete-a-message",
+ "summary": "Delete a message",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a message and it's attachments from the conversation.",
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The message or conversation does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/integrations/apps": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Integrations"
+ ],
+ "operationId": "get-details-of-all-integrations",
+ "summary": "List all the Integrations",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get the details of all Integrations available for the account",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of Integration apps",
+ "items": {
+ "$ref": "#/components/schemas/integrations_app"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Url not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/integrations/hooks": {
+ "post": {
+ "tags": [
+ "Integrations"
+ ],
+ "operationId": "create-an-integration-hook",
+ "summary": "Create an integration hook",
+ "description": "Create an integration hook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/integrations/hooks/{hook_id}": {
+ "patch": {
+ "tags": [
+ "Integrations"
+ ],
+ "operationId": "update-an-integrations-hook",
+ "summary": "Update an Integration Hook",
+ "description": "Update an Integration Hook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/hook_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/integrations_hook"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Integrations"
+ ],
+ "operationId": "delete-an-integration-hook",
+ "summary": "Delete an Integration Hook",
+ "description": "Delete an Integration Hook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/hook_id"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The hook does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/profile": {
+ "get": {
+ "tags": [
+ "Profile"
+ ],
+ "operationId": "fetchProfile",
+ "summary": "Fetch user profile",
+ "description": "Get the user profile details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/teams": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "list-all-teams",
+ "summary": "List all teams",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "List all teams available in the current account",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of teams",
+ "items": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "create-a-team",
+ "summary": "Create a team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Create a team in the account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/teams/{team_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/team_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "get-details-of-a-single-team",
+ "summary": "Get a team details",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get the details of a team in the account",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given team ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "update-a-team",
+ "summary": "Update a team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update a team's attributes",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/team"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "delete-a-team",
+ "summary": "Delete a team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a team from the account",
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The team does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/teams/{team_id}/team_members": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/team_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "get-team-members",
+ "summary": "List Agents in Team",
+ "description": "Get Details of Agents in an Team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/team_id"
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all agents in the team",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "add-new-agent-to-team",
+ "summary": "Add a New Agent",
+ "description": "Add a new Agent to Team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the team",
+ "example": [
+ 1
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "update-agents-in-team",
+ "summary": "Update Agents in Team",
+ "description": "All agents except the one passed in params will be removed",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be added to the team",
+ "example": [
+ 1
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of all agents in the team",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Teams"
+ ],
+ "operationId": "delete-agent-in-team",
+ "summary": "Remove an Agent from Team",
+ "description": "Remove an Agent from Team",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "required": [
+ "user_ids"
+ ],
+ "properties": {
+ "user_ids": {
+ "type": "array",
+ "items": {
+ "type": "integer"
+ },
+ "description": "IDs of users to be deleted from the team"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Team not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "User must exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/custom_filters": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "in": "query",
+ "name": "filter_type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ]
+ },
+ "required": false,
+ "description": "The type of custom filter"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Custom Filters"
+ ],
+ "operationId": "list-all-filters",
+ "summary": "List all custom filters",
+ "description": "List all custom filters in a category of a user",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of custom filters",
+ "items": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Custom Filters"
+ ],
+ "operationId": "create-a-custom-filter",
+ "summary": "Create a custom filter",
+ "description": "Create a custom filter in the account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/custom_filter_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Custom Filters"
+ ],
+ "operationId": "get-details-of-a-single-custom-filter",
+ "summary": "Get a custom filter details",
+ "description": "Get the details of a custom filter in the account",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given team ID does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Custom Filters"
+ ],
+ "operationId": "update-a-custom-filter",
+ "summary": "Update a custom filter",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update a custom filter's attributes",
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/custom_filter"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Custom Filters"
+ ],
+ "operationId": "delete-a-custom-filter",
+ "summary": "Delete a custom filter",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a custom filter from the account",
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The custom filter does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/webhooks": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Webhooks"
+ ],
+ "operationId": "list-all-webhooks",
+ "summary": "List all webhooks",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "List all webhooks in the account",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of webhook objects",
+ "items": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Webhooks"
+ ],
+ "operationId": "create-a-webhook",
+ "summary": "Add a webhook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Add a webhook subscription to the account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v1/accounts/{account_id}/webhooks/{webhook_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/webhook_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Webhooks"
+ ],
+ "operationId": "update-a-webhook",
+ "summary": "Update a webhook object",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Update a webhook object in the account",
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/webhook"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Webhooks"
+ ],
+ "operationId": "delete-a-webhook",
+ "summary": "Delete a webhook",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Delete a webhook from the account",
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The webhook does not exist in the account",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v2/accounts/{account_id}/reports": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/report_metric"
+ },
+ {
+ "$ref": "#/components/parameters/report_type"
+ },
+ {
+ "in": "query",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The Id of specific object in case of agent/inbox/label"
+ },
+ {
+ "in": "query",
+ "name": "since",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The timestamp from where report should start."
+ },
+ {
+ "in": "query",
+ "name": "until",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The timestamp from where report should stop."
+ }
+ ],
+ "get": {
+ "tags": [
+ "Reports"
+ ],
+ "operationId": "list-all-conversation-statistics",
+ "summary": "Get Account reports",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get Account reports for a specific type, metric and date range",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of date based conversation statistics",
+ "items": {
+ "type": "object",
+ "properties": {
+ "value": {
+ "type": "string"
+ },
+ "timestamp": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v2/accounts/{account_id}/reports/summary": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/report_type"
+ },
+ {
+ "in": "query",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The Id of specific object in case of agent/inbox/label"
+ },
+ {
+ "in": "query",
+ "name": "since",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The timestamp from where report should start."
+ },
+ {
+ "in": "query",
+ "name": "until",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The timestamp from where report should stop."
+ }
+ ],
+ "get": {
+ "tags": [
+ "Reports"
+ ],
+ "operationId": "list-all-conversation-statistics-summary",
+ "summary": "Get Account reports summary",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get Account reports summary for a specific type and date range",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_summary"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v2/accounts/{account_id}/reports/conversations": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Reports"
+ ],
+ "operationId": "get-account-conversation-metrics",
+ "summary": "Account Conversation Metrics",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get conversation metrics for Account",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "description": "Object of account conversation metrics",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ },
+ "unassigned": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/api/v2/accounts/{account_id}/reports/conversations/": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "agent"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ {
+ "in": "query",
+ "name": "user_id",
+ "schema": {
+ "type": "string"
+ },
+ "description": "The numeric ID of the user"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Reports"
+ ],
+ "operationId": "get-agent-conversation-metrics",
+ "summary": "Agent Conversation Metrics",
+ "security": [
+ {
+ "userApiKey": []
+ }
+ ],
+ "description": "Get conversation metrics for Agent",
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent based conversation metrics",
+ "items": {
+ "$ref": "#/components/schemas/agent_conversation_metrics"
+ }
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "reports not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "403": {
+ "description": "Access denied",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "bad_request_error": {
+ "title": "data",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/request_error"
+ }
+ }
+ }
+ },
+ "request_error": {
+ "type": "object",
+ "properties": {
+ "field": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ }
+ },
+ "generic_id": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ }
+ }
+ },
+ "canned_response": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the canned response"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response"
+ },
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was updated"
+ }
+ }
+ },
+ "custom_attribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Identifier"
+ },
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name"
+ },
+ "attribute_display_type": {
+ "type": "string",
+ "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value"
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue"
+ },
+ "attribute_values": {
+ "type": "string",
+ "description": "Attribute values"
+ },
+ "attribute_model": {
+ "type": "string",
+ "description": "Attribute type(conversation_attribute/contact_attribute)"
+ },
+ "default_value": {
+ "type": "string",
+ "description": "Attribute default value"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was updated"
+ }
+ }
+ },
+ "automation_rule": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Response payload that contains automation rule(s)",
+ "oneOf": [
+ {
+ "type": "array",
+ "description": "Array of automation rules (for listing endpoint)",
+ "items": {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ },
+ {
+ "type": "object",
+ "description": "Single automation rule (for show/create/update endpoints)",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "automation_rule_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the automation rule"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the rule",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to give more context about the rule",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created"
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation/message filter would work",
+ "items": {
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attribute_key": {
+ "type": "string"
+ },
+ "query_operator": {
+ "type": "string"
+ },
+ "filter_operator": {
+ "type": "string"
+ }
+ },
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "values": [
+ "help"
+ ],
+ "query_operator": "and"
+ }
+ }
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which we perform when condition matches",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action_name": {
+ "type": "string"
+ },
+ "action_params": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support",
+ "sales"
+ ]
+ }
+ }
+ },
+ "created_on": {
+ "type": "integer",
+ "description": "The timestamp when the rule was created"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ }
+ }
+ },
+ "portal": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ }
+ },
+ "portal_single": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ },
+ "portal_config": {
+ "type": "object",
+ "description": "Configuration settings for the portal",
+ "properties": {
+ "allowed_locales": {
+ "type": "array",
+ "description": "List of allowed locales for the portal",
+ "items": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The language code"
+ },
+ "articles_count": {
+ "type": "integer",
+ "description": "Number of articles in this locale"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories in this locale"
+ }
+ }
+ }
+ }
+ }
+ },
+ "portal_logo": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the logo file"
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "ID of the portal this logo belongs to"
+ },
+ "file_type": {
+ "type": "string",
+ "description": "MIME type of the file"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "file_url": {
+ "type": "string",
+ "description": "URL to access the logo file"
+ },
+ "blob_id": {
+ "type": "integer",
+ "description": "ID of the blob"
+ },
+ "filename": {
+ "type": "string",
+ "description": "Name of the file"
+ }
+ }
+ },
+ "portal_meta": {
+ "type": "object",
+ "properties": {
+ "all_articles_count": {
+ "type": "integer",
+ "description": "Total number of articles"
+ },
+ "archived_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of archived articles"
+ },
+ "published_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of published articles"
+ },
+ "draft_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of draft articles"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories"
+ },
+ "default_locale": {
+ "type": "string",
+ "description": "Default locale for the portal"
+ }
+ }
+ },
+ "portal_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the portal"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Whether the portal is archived"
+ },
+ "color": {
+ "type": "string",
+ "description": "The color code for the portal"
+ },
+ "config": {
+ "$ref": "#/components/schemas/portal_config"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain for the portal"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "The header text for the portal"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "Homepage link for the portal"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the portal"
+ },
+ "slug": {
+ "type": "string",
+ "description": "URL slug for the portal"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ },
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
+ }
+ }
+ },
+ "category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "locale": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
+ }
+ }
+ },
+ "article": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "meta": {
+ "type": "object"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "status": {
+ "type": "integer",
+ "enum": [
+ "draft",
+ "published",
+ "archived"
+ ]
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "views": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "author_id": {
+ "type": "integer"
+ },
+ "category_id": {
+ "type": "integer"
+ },
+ "folder_id": {
+ "type": "integer"
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference."
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact",
+ "example": {
+ "attribute_key": "attribute_value",
+ "signed_up_at": "dd/mm/yyyy"
+ }
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "The last activity at of the contact"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The created at of the contact"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "uuid": {
+ "type": "string",
+ "description": "UUID of the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the conversation"
+ },
+ "agent_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the agent"
+ },
+ "assignee_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the assignee"
+ },
+ "can_reply": {
+ "type": "boolean",
+ "description": "Whether the conversation can be replied to"
+ },
+ "contact_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels of the conversation"
+ },
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the conversation is muted"
+ },
+ "snoozed_until": {
+ "type": "number",
+ "description": "The time at which the conversation will be unmuted"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The time at which conversation was created"
+ },
+ "updated_at": {
+ "type": "number",
+ "description": "The time at which conversation was updated"
+ },
+ "timestamp": {
+ "type": "string",
+ "description": "The time at which conversation was created"
+ },
+ "first_reply_created_at": {
+ "type": "number",
+ "description": "The time at which the first reply was created"
+ },
+ "unread_count": {
+ "type": "number",
+ "description": "The number of unread messages"
+ },
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the conversation"
+ },
+ "priority": {
+ "type": "string",
+ "description": "The priority of the conversation"
+ },
+ "waiting_since": {
+ "type": "number",
+ "description": "The time at which the conversation was waiting"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy"
+ },
+ "applied_sla": {
+ "type": "object",
+ "description": "The applied SLA"
+ },
+ "sla_events": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "SLA event objects"
+ }
+ }
+ }
+ },
+ "message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "description": "The type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The time at which message was created"
+ },
+ "updated_at": {
+ "type": "integer",
+ "description": "The time at which message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flags which shows whether the message is private or not"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form"
+ ],
+ "description": "The type of the template message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type"
+ },
+ "sender_type": {
+ "type": "string",
+ "enum": [
+ "contact",
+ "agent",
+ "agent_bot"
+ ],
+ "description": "The type of the sender"
+ },
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "The external source IDs of the message"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "The processed message content"
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "The sentiment of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "The conversation object"
+ },
+ "attachment": {
+ "type": "object",
+ "description": "The file object attached to the image"
+ },
+ "sender": {
+ "type": "object",
+ "description": "User/Agent/AgentBot object"
+ }
+ }
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "access_token": {
+ "type": "string"
+ },
+ "account_id": {
+ "type": "number"
+ },
+ "available_name": {
+ "type": "string"
+ },
+ "avatar_url": {
+ "type": "string"
+ },
+ "confirmed": {
+ "type": "boolean"
+ },
+ "display_name": {
+ "type": "string",
+ "nullable": true
+ },
+ "message_signature": {
+ "type": "string",
+ "nullable": true
+ },
+ "email": {
+ "type": "string"
+ },
+ "hmac_identifier": {
+ "type": "string"
+ },
+ "inviter_id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "pubsub_token": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ]
+ },
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Available for users who are created through platform APIs and has custom attributes associated."
+ },
+ "accounts": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "active_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ]
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "availability": {
+ "type": "string"
+ },
+ "availability_status": {
+ "type": "string"
+ },
+ "auto_offline": {
+ "type": "boolean"
+ },
+ "custom_role_id": {
+ "type": "number",
+ "nullable": true
+ },
+ "custom_role": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "agent": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent computed by Chatwoot."
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away."
+ },
+ "confirmed": {
+ "type": "boolean",
+ "description": "Whether the agent has confirmed their email address."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the agent"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "The available name of the agent"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "The role of the agent"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent"
+ },
+ "custom_role_id": {
+ "type": "integer",
+ "description": "The custom role id of the agent"
+ }
+ }
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "Website URL"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "Widget Color used for customization of the widget"
+ },
+ "website_token": {
+ "type": "string",
+ "description": "Website Token"
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "The flag which shows whether Auto Assignment is enabled or not"
+ },
+ "web_widget_script": {
+ "type": "string",
+ "description": "Script used to load the website widget"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether greeting is enabled"
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "A greeting message when the user starts the conversation"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "ID of the channel this inbox belongs to"
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether working hours feature is enabled"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "The flag to enable collecting email from contacts"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "The flag to enable CSAT survey"
+ },
+ "auto_assignment_config": {
+ "type": "object",
+ "description": "Configuration settings for auto assignment"
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Message to show when agents are out of office"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "Configuration for working hours of the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "number",
+ "description": "Day of the week (0-6, where 0 is Sunday)"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is closed for the entire day"
+ },
+ "open_hour": {
+ "type": "number",
+ "description": "Hour when inbox opens (0-23)"
+ },
+ "open_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox opens (0-59)"
+ },
+ "close_hour": {
+ "type": "number",
+ "description": "Hour when inbox closes (0-23)"
+ },
+ "close_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox closes (0-59)"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is open for the entire day"
+ }
+ }
+ }
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone configuration for the inbox"
+ },
+ "callback_webhook_url": {
+ "type": "string",
+ "description": "Webhook URL for callbacks"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Whether to allow messages after a conversation is resolved"
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Whether to lock a contact to a single conversation"
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Type of sender name to display (e.g., friendly)"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name associated with the inbox"
+ },
+ "hmac_mandatory": {
+ "type": "boolean",
+ "description": "Whether HMAC verification is mandatory"
+ },
+ "selected_feature_flags": {
+ "type": "object",
+ "description": "Selected feature flags for the inbox"
+ },
+ "reply_time": {
+ "type": "string",
+ "description": "Expected reply time"
+ },
+ "messaging_service_sid": {
+ "type": "string",
+ "description": "Messaging service SID for SMS providers"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number associated with the inbox"
+ },
+ "medium": {
+ "type": "string",
+ "description": "Medium of communication (e.g., sms, email)"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the channel"
+ }
+ }
+ },
+ "inbox_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "The ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "provider": {
+ "type": "string",
+ "description": "The provider of the inbox"
+ }
+ }
+ },
+ "agent_bot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the agent bot"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the agent bot"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot"
+ },
+ "bot_type": {
+ "type": "string",
+ "description": "The type of the bot"
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration of the bot"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account ID if it's an account specific bot"
+ },
+ "access_token": {
+ "type": "string",
+ "description": "The access token for the bot"
+ },
+ "system_bot": {
+ "type": "boolean",
+ "description": "Whether the bot is a system bot"
+ }
+ }
+ },
+ "contact_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox_contact"
+ }
+ }
+ },
+ "contactable_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ },
+ "custom_filter": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the custom filter"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was updated"
+ }
+ }
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the webhook"
+ },
+ "url": {
+ "type": "string",
+ "description": "The url to which the events will be send"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "contact_created",
+ "contact_updated",
+ "message_created",
+ "message_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The list of subscribed events"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The id of the account which the webhook object belongs to"
+ }
+ }
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ],
+ "description": "The user role in the account"
+ }
+ }
+ },
+ "account_user": {
+ "type": "array",
+ "description": "Array of account users",
+ "items": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
+ }
+ },
+ "platform_account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ }
+ }
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account with the team is a part of"
+ },
+ "is_member": {
+ "type": "boolean",
+ "description": "This field shows whether the current user is a part of the team"
+ }
+ }
+ },
+ "integrations_app": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the integration"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "hook_type": {
+ "type": "string",
+ "description": "Whether the integration is an account or inbox integration"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the integration is enabled for the account"
+ },
+ "allow_multiple_hooks": {
+ "type": "boolean",
+ "description": "Whether multiple hooks can be created for the integration"
+ },
+ "hooks": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "If there are any hooks created for this integration"
+ }
+ }
+ },
+ "integrations_hook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration hook"
+ },
+ "app_id": {
+ "type": "string",
+ "description": "The ID of the integration app"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "Inbox ID if its an Inbox integration"
+ },
+ "account_id": {
+ "type": "string",
+ "description": "Account ID of the integration"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Whether the integration hook is enabled for the account"
+ },
+ "hook_type": {
+ "type": "boolean",
+ "description": "Whether its an account or inbox integration hook"
+ },
+ "settings": {
+ "type": "object",
+ "description": "The associated settings for the integration"
+ }
+ }
+ },
+ "public_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the contact"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The session identifier of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact"
+ },
+ "pubsub_token": {
+ "type": "string",
+ "description": "The token to be used to connect to chatwoot websocket"
+ }
+ }
+ },
+ "public_conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the conversation"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "The inbox id of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ },
+ "description": "Messages in the conversation"
+ },
+ "contact": {
+ "type": "object",
+ "description": "The contact information associated to the conversation"
+ }
+ }
+ },
+ "public_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Text content of the message"
+ },
+ "message_type": {
+ "type": "string",
+ "description": "Denotes the message type"
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Content type of the message"
+ },
+ "content_attributes": {
+ "type": "string",
+ "description": "Additional content attributes of the message"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Created at time stamp of the message"
+ },
+ "conversation_id": {
+ "type": "string",
+ "description": "Conversation Id of the message"
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "Attachments if any"
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender"
+ }
+ }
+ },
+ "public_inbox": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "Inbox identifier"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone defined on the inbox"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "The working hours defined on the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "integer",
+ "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is open the whole day"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is closed the whole day"
+ },
+ "open_hour": {
+ "type": "integer",
+ "description": "Opening hour. Can be null if closed all day"
+ },
+ "open_minutes": {
+ "type": "integer",
+ "description": "Opening minute. Can be null if closed all day"
+ },
+ "close_hour": {
+ "type": "integer",
+ "description": "Closing hour. Can be null if closed all day"
+ },
+ "close_minutes": {
+ "type": "integer",
+ "description": "Closing minute. Can be null if closed all day"
+ }
+ }
+ }
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the working hours are enabled on the inbox"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Greeting Message is enabled on the inbox"
+ },
+ "identity_validation_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the User Identity Validation is enforced on the inbox"
+ }
+ }
+ },
+ "account_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the account",
+ "example": "My Account"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the account",
+ "example": "en"
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain of the account",
+ "example": "example.com"
+ },
+ "support_email": {
+ "type": "string",
+ "description": "The support email of the account",
+ "example": "support@example.com"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "active",
+ "suspended"
+ ],
+ "description": "The status of the account",
+ "example": "active"
+ },
+ "limits": {
+ "type": "object",
+ "description": "The limits of the account",
+ "example": {}
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the account",
+ "example": {}
+ }
+ }
+ },
+ "account_user_create_update_payload": {
+ "type": "object",
+ "required": [
+ "user_id",
+ "role"
+ ],
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user",
+ "example": 1
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent",
+ "example": "administrator"
+ }
+ }
+ },
+ "platform_agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "The account ID to associate the agent bot with",
+ "example": 1
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ }
+ }
+ },
+ "agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "bot_type": {
+ "type": "integer",
+ "description": "The type of the bot (0 for webhook)",
+ "example": 0
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration for the bot",
+ "example": {}
+ }
+ }
+ },
+ "user_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the user",
+ "example": "Daniel"
+ },
+ "display_name": {
+ "type": "string",
+ "description": "Display name of the user",
+ "example": "Dan"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the user",
+ "example": "daniel@acme.inc"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password must contain uppercase, lowercase letters, number and a special character",
+ "example": "Password2!"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes you want to associate with the user",
+ "example": {}
+ }
+ }
+ },
+ "canned_response_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response",
+ "example": "Hello, {{contact.name}}! Welcome to our service."
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response",
+ "example": "welcome"
+ }
+ }
+ },
+ "custom_attribute_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name",
+ "example": "Custom Attribute"
+ },
+ "attribute_display_type": {
+ "type": "integer",
+ "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)",
+ "example": 0
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description",
+ "example": "This is a custom attribute"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value",
+ "example": "custom_attribute"
+ },
+ "attribute_values": {
+ "type": "array",
+ "description": "Attribute values",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "value1",
+ "value2"
+ ]
+ },
+ "attribute_model": {
+ "type": "integer",
+ "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)",
+ "example": 0
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).",
+ "example": "^[a-zA-Z0-9]+$"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.",
+ "example": "Please enter a valid value"
+ }
+ }
+ },
+ "agent_create_payload": {
+ "type": "object",
+ "required": [
+ "name",
+ "email",
+ "role"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Full Name of the agent",
+ "example": "John Doe"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the Agent",
+ "example": "john.doe@acme.inc"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability setting of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "agent_update_payload": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "contact_create_payload": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox to which the contact belongs",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "contact_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "conversation_create_payload": {
+ "type": "object",
+ "required": [
+ "source_id",
+ "inbox_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Conversation source id",
+ "example": "1234567890"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email",
+ "example": 1
+ },
+ "contact_id": {
+ "type": "integer",
+ "description": "Contact Id for which conversation is created",
+ "example": 1
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Lets you specify attributes like browser information",
+ "example": {
+ "browser": "Chrome",
+ "browser_version": "89.0.4389.82",
+ "os": "Windows",
+ "os_version": "10"
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
+ "example": {
+ "attribute_key": "attribute_value",
+ "priority_conversation_number": 3
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "Specify the conversation whether it's pending, open, closed",
+ "example": "open"
+ },
+ "assignee_id": {
+ "type": "integer",
+ "description": "Agent Id for assigning a conversation to an agent",
+ "example": 1
+ },
+ "team_id": {
+ "type": "integer",
+ "description": "Team Id for assigning a conversation to a team\\",
+ "example": 1
+ },
+ "snoozed_until": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Snoozed until date time",
+ "example": "2030-07-21T17:32:28Z"
+ },
+ "message": {
+ "type": "object",
+ "description": "The initial message to be sent to the conversation",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_message_create_payload": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "message_type": {
+ "type": "string",
+ "enum": [
+ "outgoing",
+ "incoming"
+ ],
+ "description": "The type of the message",
+ "example": "outgoing"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Flag to identify if it is a private note",
+ "example": false
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_email",
+ "cards",
+ "input_select",
+ "form",
+ "article"
+ ],
+ "description": "Content type of the message",
+ "example": "text"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes based on the content type",
+ "example": {}
+ },
+ "campaign_id": {
+ "type": "integer",
+ "description": "The campaign id to which the message belongs",
+ "example": 1
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ },
+ "inbox_create_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the channel",
+ "enum": [
+ "web_widget",
+ "api",
+ "email",
+ "line",
+ "telegram",
+ "whatsapp",
+ "sms"
+ ],
+ "example": "web_widget"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "inbox_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "team_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team",
+ "example": "Support Team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the team",
+ "example": "This is a team of support agents"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team",
+ "example": true
+ }
+ }
+ },
+ "custom_filter_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter",
+ "example": "My Custom Filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter",
+ "example": "conversation"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter",
+ "example": {}
+ }
+ }
+ },
+ "webhook_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The url where the events should be sent",
+ "example": "https://example.com/webhook"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "message_created",
+ "message_updated",
+ "contact_created",
+ "contact_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The events you want to subscribe to.",
+ "example": [
+ "conversation_created",
+ "conversation_status_changed"
+ ]
+ }
+ }
+ },
+ "integrations_hook_create_payload": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "integer",
+ "description": "The ID of app for which integration hook is being created",
+ "example": 1
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "The inbox ID, if the hook is an inbox hook",
+ "example": 1
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "integrations_hook_update_payload": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "automation_rule_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Rule name",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the automation and actions",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created",
+ "description": "The event when you want to execute the automation actions"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support"
+ ]
+ }
+ }
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "query_operator": "OR",
+ "values": [
+ "help"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "portal_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string",
+ "description": "Header color for help-center in hex format",
+ "example": "#FFFFFF"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain to display help center.",
+ "example": "chatwoot.help"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "Help center header",
+ "example": "Handbook"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "link to main dashboard",
+ "example": "https://www.chatwoot.com/"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name for the portal",
+ "example": "Handbook"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal",
+ "example": "Handbook"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Slug for the portal to display in link",
+ "example": "handbook"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Status to check if portal is live",
+ "example": false
+ },
+ "config": {
+ "type": "object",
+ "description": "Configuration about supporting locales",
+ "example": {
+ "allowed_locales": [
+ "en",
+ "es"
+ ],
+ "default_locale": "en"
+ }
+ }
+ }
+ },
+ "category_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the category",
+ "example": "Category Name"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the category",
+ "example": "Category description"
+ },
+ "position": {
+ "type": "integer",
+ "description": "Category position in the portal list to sort",
+ "example": 1
+ },
+ "slug": {
+ "type": "string",
+ "description": "The category slug used in the URL",
+ "example": "category-name"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the category",
+ "example": "en"
+ },
+ "icon": {
+ "type": "string",
+ "description": "The icon of the category as a string (emoji)",
+ "example": "📚"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.",
+ "example": 1
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages",
+ "example": 2
+ }
+ }
+ },
+ "article_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the article",
+ "example": "Article Title"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the article",
+ "example": "article-title"
+ },
+ "position": {
+ "type": "integer",
+ "description": "article position in category",
+ "example": 1
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content.",
+ "example": "This is the content of the article"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the article",
+ "example": "This is the description of the article"
+ },
+ "category_id": {
+ "type": "integer",
+ "description": "The category id of the article",
+ "example": 1
+ },
+ "author_id": {
+ "type": "integer",
+ "description": "The author agent id of the article",
+ "example": 1
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference.",
+ "example": 2
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the article. 0 for draft, 1 for published, 2 for archived",
+ "example": 1
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the article",
+ "example": "en"
+ },
+ "meta": {
+ "type": "object",
+ "description": "Use for search",
+ "example": {
+ "tags": [
+ "article_name"
+ ],
+ "title": "article title",
+ "description": "article description"
+ }
+ }
+ }
+ },
+ "public_contact_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "External identifier of the contact",
+ "example": "1234567890"
+ },
+ "identifier_hash": {
+ "type": "string",
+ "description": "Identifier hash prepared for HMAC authentication",
+ "example": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact",
+ "example": "Alice"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the customer",
+ "example": {}
+ }
+ }
+ },
+ "public_message_create_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Content for the message",
+ "example": "Hello, how can I help you?"
+ },
+ "echo_id": {
+ "type": "string",
+ "description": "Temporary identifier which will be passed back via websockets",
+ "example": "1234567890"
+ }
+ }
+ },
+ "public_message_update_payload": {
+ "type": "object",
+ "properties": {
+ "submitted_values": {
+ "type": "object",
+ "description": "Replies to the Bot Message Types",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the submiitted value",
+ "example": "My Name"
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the submitted value",
+ "example": "My Title"
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the submitted value",
+ "example": "value"
+ },
+ "csat_survey_response": {
+ "type": "object",
+ "description": "The CSAT survey response",
+ "properties": {
+ "feedback_message": {
+ "type": "string",
+ "description": "The feedback message of the CSAT survey response",
+ "example": "Great service!"
+ },
+ "rating": {
+ "type": "integer",
+ "description": "The rating of the CSAT survey response",
+ "example": 5
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "public_conversation_create_payload": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the conversation",
+ "example": {}
+ }
+ }
+ },
+ "extended_contact": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the user"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "online",
+ "offline"
+ ],
+ "description": "Availability status of the user"
+ }
+ }
+ }
+ ]
+ },
+ "contact_base": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ },
+ "contact_list": {
+ "type": "array",
+ "description": "array of contacts",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ }
+ },
+ "contact_conversations": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "display_id": {
+ "type": "number"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "contact_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "conversation_list": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_show": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "conversation_status_toggle": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object"
+ },
+ "payload": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "current_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved"
+ ]
+ },
+ "conversation_id": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "conversation_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "account_summary": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ },
+ "previous": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "agent_conversation_metrics": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "thumbnail": {
+ "type": "string"
+ },
+ "availability": {
+ "type": "string"
+ },
+ "metric": {
+ "type": "object",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "contact_detail": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of entity",
+ "enum": [
+ "contact"
+ ]
+ }
+ }
+ },
+ "message_detailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "description": "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form",
+ "input_csat"
+ ],
+ "description": "The type of the message content"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type",
+ "properties": {
+ "in_reply_to": {
+ "type": "string",
+ "description": "ID of the message this is replying to",
+ "nullable": true
+ }
+ }
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The timestamp when message was created"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flag which shows whether the message is private or not"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message",
+ "nullable": true
+ },
+ "sender": {
+ "$ref": "#/components/schemas/contact_detail"
+ }
+ }
+ },
+ "conversation_meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Labels associated with the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "object",
+ "properties": {
+ "device_name": {
+ "type": "string",
+ "description": "Name of the device"
+ },
+ "browser_name": {
+ "type": "string",
+ "description": "Name of the browser"
+ },
+ "platform_name": {
+ "type": "string",
+ "description": "Name of the platform"
+ },
+ "browser_version": {
+ "type": "string",
+ "description": "Version of the browser"
+ },
+ "platform_version": {
+ "type": "string",
+ "description": "Version of the platform"
+ }
+ }
+ },
+ "referer": {
+ "type": "string",
+ "description": "Referrer URL"
+ },
+ "initiated_at": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "description": "Timestamp when the conversation was initiated"
+ }
+ }
+ },
+ "browser_language": {
+ "type": "string",
+ "description": "Browser language setting"
+ },
+ "conversation_language": {
+ "type": "string",
+ "description": "Conversation language"
+ }
+ },
+ "description": "Additional attributes of the conversation"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact_detail"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the agent last saw the conversation",
+ "nullable": true
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the assignee last saw the conversation",
+ "nullable": true
+ }
+ }
+ },
+ "conversation_messages": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/conversation_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message_detailed"
+ },
+ "description": "List of messages in the conversation"
+ }
+ }
+ },
+ "contact_meta": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer",
+ "description": "Total number of contacts"
+ },
+ "current_page": {
+ "type": "string",
+ "description": "Current page number"
+ }
+ }
+ },
+ "contact_inbox": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source identifier for the contact inbox"
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL for the inbox avatar"
+ },
+ "channel_id": {
+ "type": "integer",
+ "description": "ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "Type of channel"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the inbox",
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "contact_list_item": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the contact",
+ "enum": [
+ "online",
+ "offline"
+ ]
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact",
+ "nullable": true
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity",
+ "nullable": true
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when contact was created"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "description": "List of inboxes associated with this contact",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ }
+ }
+ }
+ },
+ "contacts_list_response": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/contact_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_list_item"
+ },
+ "description": "List of contacts"
+ }
+ }
+ },
+ "contact_show_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/contact_list_item"
+ }
+ }
+ },
+ "contact_conversation_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Content of the message"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "integer",
+ "description": "ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "description": "Type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when message was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "Formatted datetime when message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Whether the message is private"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the message",
+ "nullable": true
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Type of the content"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes of the content"
+ },
+ "sender_type": {
+ "type": "string",
+ "description": "Type of the sender",
+ "nullable": true
+ },
+ "sender_id": {
+ "type": "integer",
+ "description": "ID of the sender",
+ "nullable": true
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "External source IDs"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "Processed message content",
+ "nullable": true
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "Sentiment analysis of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "Conversation details",
+ "properties": {
+ "assignee_id": {
+ "type": "integer",
+ "description": "ID of the assignee",
+ "nullable": true
+ },
+ "unread_count": {
+ "type": "integer",
+ "description": "Count of unread messages"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity"
+ },
+ "contact_inbox": {
+ "type": "object",
+ "description": "Contact inbox details",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the contact inbox"
+ }
+ }
+ }
+ }
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the sender"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "Available name of the sender"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL of the sender's avatar"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Thumbnail URL of the sender"
+ }
+ }
+ }
+ }
+ },
+ "contact_conversations_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "description": "List of conversations for the contact"
+ }
+ }
+ },
+ "contactable_inboxes_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ },
+ "description": "List of contactable inboxes for the contact"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "account_id": {
+ "in": "path",
+ "name": "account_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the account"
+ },
+ "agent_bot_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agentbot to be updated"
+ },
+ "team_id": {
+ "in": "path",
+ "name": "team_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the team to be updated"
+ },
+ "inbox_id": {
+ "in": "path",
+ "name": "inbox_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the Inbox"
+ },
+ "hook_id": {
+ "in": "path",
+ "name": "hook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the integration hook"
+ },
+ "source_id": {
+ "in": "path",
+ "name": "source_id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ },
+ "contact_sort_param": {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "name",
+ "email",
+ "phone_number",
+ "last_activity_at",
+ "-name",
+ "-email",
+ "-phone_number",
+ "-last_activity_at"
+ ]
+ },
+ "required": false,
+ "description": "The attribute by which list should be sorted"
+ },
+ "conversation_id": {
+ "in": "path",
+ "name": "conversation_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the conversation"
+ },
+ "conversation_uuid": {
+ "in": "path",
+ "name": "conversation_uuid",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The uuid of the conversation"
+ },
+ "custom_filter_id": {
+ "in": "path",
+ "name": "custom_filter_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the custom filter"
+ },
+ "webhook_id": {
+ "in": "path",
+ "name": "webhook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the webhook"
+ },
+ "message_id": {
+ "in": "path",
+ "name": "message_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the message"
+ },
+ "page": {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": false,
+ "description": "The page parameter"
+ },
+ "platform_user_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the user on the platform"
+ },
+ "report_type": {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account",
+ "agent",
+ "inbox",
+ "label",
+ "team"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ "report_metric": {
+ "in": "query",
+ "name": "metric",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversations_count",
+ "incoming_messages_count",
+ "outgoing_messages_count",
+ "avg_first_response_time",
+ "avg_resolution_time",
+ "resolutions_count"
+ ]
+ },
+ "required": true,
+ "description": "The type of metric"
+ },
+ "public_inbox_identifier": {
+ "in": "path",
+ "name": "inbox_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The identifier obtained from API inbox channel"
+ },
+ "public_contact_identifier": {
+ "in": "path",
+ "name": "contact_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The source id of contact obtained on contact create"
+ },
+ "portal_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The slug identifier of the portal"
+ }
+ },
+ "securitySchemes": {
+ "userApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
+ },
+ "agentBotApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
+ },
+ "platformAppApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
+ }
+ }
+ },
+ "tags": [
+ {
+ "name": "Account AgentBots",
+ "description": "Account-specific Agent Bots"
+ },
+ {
+ "name": "Agents",
+ "description": "Agent management APIs"
+ },
+ {
+ "name": "Canned Responses",
+ "description": "Pre-defined responses for common queries"
+ },
+ {
+ "name": "Contacts",
+ "description": "Contact management APIs"
+ },
+ {
+ "name": "Contact Labels",
+ "description": "Manage contact labels"
+ },
+ {
+ "name": "Conversation Assignments",
+ "description": "Manage conversation assignments"
+ },
+ {
+ "name": "Conversation Labels",
+ "description": "Manage conversation labels"
+ },
+ {
+ "name": "Conversations",
+ "description": "Conversation management APIs"
+ },
+ {
+ "name": "Custom Attributes",
+ "description": "Custom fields for contacts and conversations"
+ },
+ {
+ "name": "Custom Filters",
+ "description": "Saved filters for conversations"
+ },
+ {
+ "name": "Inboxes",
+ "description": "Communication channels setup"
+ },
+ {
+ "name": "Integrations",
+ "description": "Third-party integrations"
+ },
+ {
+ "name": "Messages",
+ "description": "Message management APIs"
+ },
+ {
+ "name": "Profile",
+ "description": "User profile APIs"
+ },
+ {
+ "name": "Reports",
+ "description": "Analytics and reporting APIs"
+ },
+ {
+ "name": "Teams",
+ "description": "Team management APIs"
+ },
+ {
+ "name": "Webhooks",
+ "description": "Event notification webhooks"
+ },
+ {
+ "name": "Automation Rule",
+ "description": "Workflow automation rules"
+ },
+ {
+ "name": "Help Center",
+ "description": "Knowledge base management"
+ }
+ ],
+ "x-tagGroups": [
+ {
+ "name": "Platform",
+ "tags": [
+ "Accounts",
+ "Account Users",
+ "AgentBots",
+ "Users"
+ ]
+ },
+ {
+ "name": "Application",
+ "tags": [
+ "Account AgentBots",
+ "Agents",
+ "Canned Responses",
+ "Contacts",
+ "Contact Labels",
+ "Conversation Assignments",
+ "Conversation Labels",
+ "Conversations",
+ "Custom Attributes",
+ "Custom Filters",
+ "Inboxes",
+ "Integrations",
+ "Messages",
+ "Profile",
+ "Reports",
+ "Teams",
+ "Webhooks",
+ "Automation Rule",
+ "Help Center"
+ ]
+ },
+ {
+ "name": "Client",
+ "tags": [
+ "Contacts API",
+ "Conversations API",
+ "Messages API"
+ ]
+ },
+ {
+ "name": "Others",
+ "tags": [
+ "CSAT Survey Page"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/swagger/tag_groups/client.yml b/swagger/tag_groups/client.yml
new file mode 100644
index 000000000..fdd177b97
--- /dev/null
+++ b/swagger/tag_groups/client.yml
@@ -0,0 +1,33 @@
+openapi: '3.0.4'
+info:
+ title: Chatwoot - Client API
+ description: Client API endpoints for Chatwoot
+ version: 1.1.0
+ termsOfService: https://www.chatwoot.com/terms-of-service/
+ contact:
+ email: hello@chatwoot.com
+ license:
+ name: MIT License
+ url: https://opensource.org/licenses/MIT
+servers:
+ - url: https://app.chatwoot.com/
+tags:
+ - name: Contacts API
+ description: APIs for managing contacts from client applications
+ - name: Conversations API
+ description: APIs for managing conversations from client applications
+ - name: Messages API
+ description: APIs for managing messages from client applications
+paths:
+ $ref: ../paths/index.yml
+components:
+ schemas:
+ $ref: ../definitions/index.yml
+ parameters:
+ $ref: ../parameters/index.yml
+ securitySchemes:
+ userApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
\ No newline at end of file
diff --git a/swagger/tag_groups/client_swagger.json b/swagger/tag_groups/client_swagger.json
new file mode 100644
index 000000000..6d471da43
--- /dev/null
+++ b/swagger/tag_groups/client_swagger.json
@@ -0,0 +1,4963 @@
+{
+ "openapi": "3.0.4",
+ "info": {
+ "title": "Chatwoot",
+ "description": "This is the API documentation for Chatwoot server.",
+ "version": "1.1.0",
+ "termsOfService": "https://www.chatwoot.com/terms-of-service/",
+ "contact": {
+ "email": "hello@chatwoot.com"
+ },
+ "license": {
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://app.chatwoot.com/"
+ }
+ ],
+ "paths": {
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Contacts API"
+ ],
+ "operationId": "create-a-contact",
+ "summary": "Create a contact",
+ "description": "Create a contact",
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Contacts API"
+ ],
+ "operationId": "get-details-of-a-contact",
+ "summary": "Get a contact",
+ "description": "Get the details of a contact",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given contact does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Contacts API"
+ ],
+ "operationId": "update-a-contact",
+ "summary": "Update a contact",
+ "description": "Update a contact's attributes",
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_contact"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "create-a-conversation",
+ "summary": "Create a conversation",
+ "description": "Create a conversation",
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "list-all-contact-conversations",
+ "summary": "List all conversations",
+ "description": "List all conversations for the contact",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of conversations",
+ "items": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "get-single-conversation",
+ "summary": "Get a single conversation",
+ "description": "Retrieves the details of a specific conversation",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_status": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "resolve-conversation",
+ "summary": "Resolve a conversation",
+ "description": "Marks a conversation as resolved",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Conversation resolved successfully",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_conversation"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_typing": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "toggle-typing-status",
+ "summary": "Toggle typing status",
+ "description": "Toggles the typing status in a conversation",
+ "security": [],
+ "parameters": [
+ {
+ "name": "typing_status",
+ "in": "query",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Typing status, either 'on' or 'off'"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "typing_status": {
+ "type": "string",
+ "enum": [
+ "on",
+ "off"
+ ],
+ "description": "The typing status to set",
+ "example": "on"
+ }
+ }
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Typing status toggled successfully"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/update_last_seen": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Conversations API"
+ ],
+ "operationId": "update-last-seen",
+ "summary": "Update last seen",
+ "description": "Updates the last seen time of the contact in a conversation",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Last seen updated successfully"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "Conversation not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ }
+ ],
+ "post": {
+ "tags": [
+ "Messages API"
+ ],
+ "operationId": "create-a-message",
+ "summary": "Create a message",
+ "description": "Create a message",
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message_create_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "get": {
+ "tags": [
+ "Messages API"
+ ],
+ "operationId": "list-all-converation-messages",
+ "summary": "List all messages",
+ "description": "List all messages in the conversation",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of messages",
+ "items": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/public_inbox_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/public_contact_identifier"
+ },
+ {
+ "$ref": "#/components/parameters/conversation_id"
+ },
+ {
+ "$ref": "#/components/parameters/message_id"
+ }
+ ],
+ "patch": {
+ "tags": [
+ "Messages API"
+ ],
+ "operationId": "update-a-message",
+ "summary": "Update a message",
+ "description": "Update a message",
+ "security": [],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/public_message"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "bad_request_error": {
+ "title": "data",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/request_error"
+ }
+ }
+ }
+ },
+ "request_error": {
+ "type": "object",
+ "properties": {
+ "field": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ }
+ },
+ "generic_id": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ }
+ }
+ },
+ "canned_response": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the canned response"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response"
+ },
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was updated"
+ }
+ }
+ },
+ "custom_attribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Identifier"
+ },
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name"
+ },
+ "attribute_display_type": {
+ "type": "string",
+ "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value"
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue"
+ },
+ "attribute_values": {
+ "type": "string",
+ "description": "Attribute values"
+ },
+ "attribute_model": {
+ "type": "string",
+ "description": "Attribute type(conversation_attribute/contact_attribute)"
+ },
+ "default_value": {
+ "type": "string",
+ "description": "Attribute default value"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was updated"
+ }
+ }
+ },
+ "automation_rule": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Response payload that contains automation rule(s)",
+ "oneOf": [
+ {
+ "type": "array",
+ "description": "Array of automation rules (for listing endpoint)",
+ "items": {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ },
+ {
+ "type": "object",
+ "description": "Single automation rule (for show/create/update endpoints)",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "automation_rule_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the automation rule"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the rule",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to give more context about the rule",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created"
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation/message filter would work",
+ "items": {
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attribute_key": {
+ "type": "string"
+ },
+ "query_operator": {
+ "type": "string"
+ },
+ "filter_operator": {
+ "type": "string"
+ }
+ },
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "values": [
+ "help"
+ ],
+ "query_operator": "and"
+ }
+ }
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which we perform when condition matches",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action_name": {
+ "type": "string"
+ },
+ "action_params": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support",
+ "sales"
+ ]
+ }
+ }
+ },
+ "created_on": {
+ "type": "integer",
+ "description": "The timestamp when the rule was created"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ }
+ }
+ },
+ "portal": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ }
+ },
+ "portal_single": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ },
+ "portal_config": {
+ "type": "object",
+ "description": "Configuration settings for the portal",
+ "properties": {
+ "allowed_locales": {
+ "type": "array",
+ "description": "List of allowed locales for the portal",
+ "items": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The language code"
+ },
+ "articles_count": {
+ "type": "integer",
+ "description": "Number of articles in this locale"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories in this locale"
+ }
+ }
+ }
+ }
+ }
+ },
+ "portal_logo": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the logo file"
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "ID of the portal this logo belongs to"
+ },
+ "file_type": {
+ "type": "string",
+ "description": "MIME type of the file"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "file_url": {
+ "type": "string",
+ "description": "URL to access the logo file"
+ },
+ "blob_id": {
+ "type": "integer",
+ "description": "ID of the blob"
+ },
+ "filename": {
+ "type": "string",
+ "description": "Name of the file"
+ }
+ }
+ },
+ "portal_meta": {
+ "type": "object",
+ "properties": {
+ "all_articles_count": {
+ "type": "integer",
+ "description": "Total number of articles"
+ },
+ "archived_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of archived articles"
+ },
+ "published_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of published articles"
+ },
+ "draft_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of draft articles"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories"
+ },
+ "default_locale": {
+ "type": "string",
+ "description": "Default locale for the portal"
+ }
+ }
+ },
+ "portal_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the portal"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Whether the portal is archived"
+ },
+ "color": {
+ "type": "string",
+ "description": "The color code for the portal"
+ },
+ "config": {
+ "$ref": "#/components/schemas/portal_config"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain for the portal"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "The header text for the portal"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "Homepage link for the portal"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the portal"
+ },
+ "slug": {
+ "type": "string",
+ "description": "URL slug for the portal"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ },
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
+ }
+ }
+ },
+ "category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "locale": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
+ }
+ }
+ },
+ "article": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "meta": {
+ "type": "object"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "status": {
+ "type": "integer",
+ "enum": [
+ "draft",
+ "published",
+ "archived"
+ ]
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "views": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "author_id": {
+ "type": "integer"
+ },
+ "category_id": {
+ "type": "integer"
+ },
+ "folder_id": {
+ "type": "integer"
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference."
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact",
+ "example": {
+ "attribute_key": "attribute_value",
+ "signed_up_at": "dd/mm/yyyy"
+ }
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "The last activity at of the contact"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The created at of the contact"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "uuid": {
+ "type": "string",
+ "description": "UUID of the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the conversation"
+ },
+ "agent_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the agent"
+ },
+ "assignee_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the assignee"
+ },
+ "can_reply": {
+ "type": "boolean",
+ "description": "Whether the conversation can be replied to"
+ },
+ "contact_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels of the conversation"
+ },
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the conversation is muted"
+ },
+ "snoozed_until": {
+ "type": "number",
+ "description": "The time at which the conversation will be unmuted"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The time at which conversation was created"
+ },
+ "updated_at": {
+ "type": "number",
+ "description": "The time at which conversation was updated"
+ },
+ "timestamp": {
+ "type": "string",
+ "description": "The time at which conversation was created"
+ },
+ "first_reply_created_at": {
+ "type": "number",
+ "description": "The time at which the first reply was created"
+ },
+ "unread_count": {
+ "type": "number",
+ "description": "The number of unread messages"
+ },
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the conversation"
+ },
+ "priority": {
+ "type": "string",
+ "description": "The priority of the conversation"
+ },
+ "waiting_since": {
+ "type": "number",
+ "description": "The time at which the conversation was waiting"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy"
+ },
+ "applied_sla": {
+ "type": "object",
+ "description": "The applied SLA"
+ },
+ "sla_events": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "SLA event objects"
+ }
+ }
+ }
+ },
+ "message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "description": "The type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The time at which message was created"
+ },
+ "updated_at": {
+ "type": "integer",
+ "description": "The time at which message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flags which shows whether the message is private or not"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form"
+ ],
+ "description": "The type of the template message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type"
+ },
+ "sender_type": {
+ "type": "string",
+ "enum": [
+ "contact",
+ "agent",
+ "agent_bot"
+ ],
+ "description": "The type of the sender"
+ },
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "The external source IDs of the message"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "The processed message content"
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "The sentiment of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "The conversation object"
+ },
+ "attachment": {
+ "type": "object",
+ "description": "The file object attached to the image"
+ },
+ "sender": {
+ "type": "object",
+ "description": "User/Agent/AgentBot object"
+ }
+ }
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "access_token": {
+ "type": "string"
+ },
+ "account_id": {
+ "type": "number"
+ },
+ "available_name": {
+ "type": "string"
+ },
+ "avatar_url": {
+ "type": "string"
+ },
+ "confirmed": {
+ "type": "boolean"
+ },
+ "display_name": {
+ "type": "string",
+ "nullable": true
+ },
+ "message_signature": {
+ "type": "string",
+ "nullable": true
+ },
+ "email": {
+ "type": "string"
+ },
+ "hmac_identifier": {
+ "type": "string"
+ },
+ "inviter_id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "pubsub_token": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ]
+ },
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Available for users who are created through platform APIs and has custom attributes associated."
+ },
+ "accounts": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "active_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ]
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "availability": {
+ "type": "string"
+ },
+ "availability_status": {
+ "type": "string"
+ },
+ "auto_offline": {
+ "type": "boolean"
+ },
+ "custom_role_id": {
+ "type": "number",
+ "nullable": true
+ },
+ "custom_role": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "agent": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent computed by Chatwoot."
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away."
+ },
+ "confirmed": {
+ "type": "boolean",
+ "description": "Whether the agent has confirmed their email address."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the agent"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "The available name of the agent"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "The role of the agent"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent"
+ },
+ "custom_role_id": {
+ "type": "integer",
+ "description": "The custom role id of the agent"
+ }
+ }
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "Website URL"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "Widget Color used for customization of the widget"
+ },
+ "website_token": {
+ "type": "string",
+ "description": "Website Token"
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "The flag which shows whether Auto Assignment is enabled or not"
+ },
+ "web_widget_script": {
+ "type": "string",
+ "description": "Script used to load the website widget"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether greeting is enabled"
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "A greeting message when the user starts the conversation"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "ID of the channel this inbox belongs to"
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether working hours feature is enabled"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "The flag to enable collecting email from contacts"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "The flag to enable CSAT survey"
+ },
+ "auto_assignment_config": {
+ "type": "object",
+ "description": "Configuration settings for auto assignment"
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Message to show when agents are out of office"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "Configuration for working hours of the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "number",
+ "description": "Day of the week (0-6, where 0 is Sunday)"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is closed for the entire day"
+ },
+ "open_hour": {
+ "type": "number",
+ "description": "Hour when inbox opens (0-23)"
+ },
+ "open_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox opens (0-59)"
+ },
+ "close_hour": {
+ "type": "number",
+ "description": "Hour when inbox closes (0-23)"
+ },
+ "close_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox closes (0-59)"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is open for the entire day"
+ }
+ }
+ }
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone configuration for the inbox"
+ },
+ "callback_webhook_url": {
+ "type": "string",
+ "description": "Webhook URL for callbacks"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Whether to allow messages after a conversation is resolved"
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Whether to lock a contact to a single conversation"
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Type of sender name to display (e.g., friendly)"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name associated with the inbox"
+ },
+ "hmac_mandatory": {
+ "type": "boolean",
+ "description": "Whether HMAC verification is mandatory"
+ },
+ "selected_feature_flags": {
+ "type": "object",
+ "description": "Selected feature flags for the inbox"
+ },
+ "reply_time": {
+ "type": "string",
+ "description": "Expected reply time"
+ },
+ "messaging_service_sid": {
+ "type": "string",
+ "description": "Messaging service SID for SMS providers"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number associated with the inbox"
+ },
+ "medium": {
+ "type": "string",
+ "description": "Medium of communication (e.g., sms, email)"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the channel"
+ }
+ }
+ },
+ "inbox_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "The ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "provider": {
+ "type": "string",
+ "description": "The provider of the inbox"
+ }
+ }
+ },
+ "agent_bot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the agent bot"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the agent bot"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot"
+ },
+ "bot_type": {
+ "type": "string",
+ "description": "The type of the bot"
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration of the bot"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account ID if it's an account specific bot"
+ },
+ "access_token": {
+ "type": "string",
+ "description": "The access token for the bot"
+ },
+ "system_bot": {
+ "type": "boolean",
+ "description": "Whether the bot is a system bot"
+ }
+ }
+ },
+ "contact_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox_contact"
+ }
+ }
+ },
+ "contactable_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ },
+ "custom_filter": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the custom filter"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was updated"
+ }
+ }
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the webhook"
+ },
+ "url": {
+ "type": "string",
+ "description": "The url to which the events will be send"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "contact_created",
+ "contact_updated",
+ "message_created",
+ "message_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The list of subscribed events"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The id of the account which the webhook object belongs to"
+ }
+ }
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ],
+ "description": "The user role in the account"
+ }
+ }
+ },
+ "account_user": {
+ "type": "array",
+ "description": "Array of account users",
+ "items": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
+ }
+ },
+ "platform_account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ }
+ }
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account with the team is a part of"
+ },
+ "is_member": {
+ "type": "boolean",
+ "description": "This field shows whether the current user is a part of the team"
+ }
+ }
+ },
+ "integrations_app": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the integration"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "hook_type": {
+ "type": "string",
+ "description": "Whether the integration is an account or inbox integration"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the integration is enabled for the account"
+ },
+ "allow_multiple_hooks": {
+ "type": "boolean",
+ "description": "Whether multiple hooks can be created for the integration"
+ },
+ "hooks": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "If there are any hooks created for this integration"
+ }
+ }
+ },
+ "integrations_hook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration hook"
+ },
+ "app_id": {
+ "type": "string",
+ "description": "The ID of the integration app"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "Inbox ID if its an Inbox integration"
+ },
+ "account_id": {
+ "type": "string",
+ "description": "Account ID of the integration"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Whether the integration hook is enabled for the account"
+ },
+ "hook_type": {
+ "type": "boolean",
+ "description": "Whether its an account or inbox integration hook"
+ },
+ "settings": {
+ "type": "object",
+ "description": "The associated settings for the integration"
+ }
+ }
+ },
+ "public_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the contact"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The session identifier of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact"
+ },
+ "pubsub_token": {
+ "type": "string",
+ "description": "The token to be used to connect to chatwoot websocket"
+ }
+ }
+ },
+ "public_conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the conversation"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "The inbox id of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ },
+ "description": "Messages in the conversation"
+ },
+ "contact": {
+ "type": "object",
+ "description": "The contact information associated to the conversation"
+ }
+ }
+ },
+ "public_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Text content of the message"
+ },
+ "message_type": {
+ "type": "string",
+ "description": "Denotes the message type"
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Content type of the message"
+ },
+ "content_attributes": {
+ "type": "string",
+ "description": "Additional content attributes of the message"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Created at time stamp of the message"
+ },
+ "conversation_id": {
+ "type": "string",
+ "description": "Conversation Id of the message"
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "Attachments if any"
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender"
+ }
+ }
+ },
+ "public_inbox": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "Inbox identifier"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone defined on the inbox"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "The working hours defined on the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "integer",
+ "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is open the whole day"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is closed the whole day"
+ },
+ "open_hour": {
+ "type": "integer",
+ "description": "Opening hour. Can be null if closed all day"
+ },
+ "open_minutes": {
+ "type": "integer",
+ "description": "Opening minute. Can be null if closed all day"
+ },
+ "close_hour": {
+ "type": "integer",
+ "description": "Closing hour. Can be null if closed all day"
+ },
+ "close_minutes": {
+ "type": "integer",
+ "description": "Closing minute. Can be null if closed all day"
+ }
+ }
+ }
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the working hours are enabled on the inbox"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Greeting Message is enabled on the inbox"
+ },
+ "identity_validation_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the User Identity Validation is enforced on the inbox"
+ }
+ }
+ },
+ "account_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the account",
+ "example": "My Account"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the account",
+ "example": "en"
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain of the account",
+ "example": "example.com"
+ },
+ "support_email": {
+ "type": "string",
+ "description": "The support email of the account",
+ "example": "support@example.com"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "active",
+ "suspended"
+ ],
+ "description": "The status of the account",
+ "example": "active"
+ },
+ "limits": {
+ "type": "object",
+ "description": "The limits of the account",
+ "example": {}
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the account",
+ "example": {}
+ }
+ }
+ },
+ "account_user_create_update_payload": {
+ "type": "object",
+ "required": [
+ "user_id",
+ "role"
+ ],
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user",
+ "example": 1
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent",
+ "example": "administrator"
+ }
+ }
+ },
+ "platform_agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "The account ID to associate the agent bot with",
+ "example": 1
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ }
+ }
+ },
+ "agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "bot_type": {
+ "type": "integer",
+ "description": "The type of the bot (0 for webhook)",
+ "example": 0
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration for the bot",
+ "example": {}
+ }
+ }
+ },
+ "user_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the user",
+ "example": "Daniel"
+ },
+ "display_name": {
+ "type": "string",
+ "description": "Display name of the user",
+ "example": "Dan"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the user",
+ "example": "daniel@acme.inc"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password must contain uppercase, lowercase letters, number and a special character",
+ "example": "Password2!"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes you want to associate with the user",
+ "example": {}
+ }
+ }
+ },
+ "canned_response_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response",
+ "example": "Hello, {{contact.name}}! Welcome to our service."
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response",
+ "example": "welcome"
+ }
+ }
+ },
+ "custom_attribute_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name",
+ "example": "Custom Attribute"
+ },
+ "attribute_display_type": {
+ "type": "integer",
+ "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)",
+ "example": 0
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description",
+ "example": "This is a custom attribute"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value",
+ "example": "custom_attribute"
+ },
+ "attribute_values": {
+ "type": "array",
+ "description": "Attribute values",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "value1",
+ "value2"
+ ]
+ },
+ "attribute_model": {
+ "type": "integer",
+ "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)",
+ "example": 0
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).",
+ "example": "^[a-zA-Z0-9]+$"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.",
+ "example": "Please enter a valid value"
+ }
+ }
+ },
+ "agent_create_payload": {
+ "type": "object",
+ "required": [
+ "name",
+ "email",
+ "role"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Full Name of the agent",
+ "example": "John Doe"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the Agent",
+ "example": "john.doe@acme.inc"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability setting of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "agent_update_payload": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "contact_create_payload": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox to which the contact belongs",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "contact_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "conversation_create_payload": {
+ "type": "object",
+ "required": [
+ "source_id",
+ "inbox_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Conversation source id",
+ "example": "1234567890"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email",
+ "example": 1
+ },
+ "contact_id": {
+ "type": "integer",
+ "description": "Contact Id for which conversation is created",
+ "example": 1
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Lets you specify attributes like browser information",
+ "example": {
+ "browser": "Chrome",
+ "browser_version": "89.0.4389.82",
+ "os": "Windows",
+ "os_version": "10"
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
+ "example": {
+ "attribute_key": "attribute_value",
+ "priority_conversation_number": 3
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "Specify the conversation whether it's pending, open, closed",
+ "example": "open"
+ },
+ "assignee_id": {
+ "type": "integer",
+ "description": "Agent Id for assigning a conversation to an agent",
+ "example": 1
+ },
+ "team_id": {
+ "type": "integer",
+ "description": "Team Id for assigning a conversation to a team\\",
+ "example": 1
+ },
+ "snoozed_until": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Snoozed until date time",
+ "example": "2030-07-21T17:32:28Z"
+ },
+ "message": {
+ "type": "object",
+ "description": "The initial message to be sent to the conversation",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_message_create_payload": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "message_type": {
+ "type": "string",
+ "enum": [
+ "outgoing",
+ "incoming"
+ ],
+ "description": "The type of the message",
+ "example": "outgoing"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Flag to identify if it is a private note",
+ "example": false
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_email",
+ "cards",
+ "input_select",
+ "form",
+ "article"
+ ],
+ "description": "Content type of the message",
+ "example": "text"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes based on the content type",
+ "example": {}
+ },
+ "campaign_id": {
+ "type": "integer",
+ "description": "The campaign id to which the message belongs",
+ "example": 1
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ },
+ "inbox_create_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the channel",
+ "enum": [
+ "web_widget",
+ "api",
+ "email",
+ "line",
+ "telegram",
+ "whatsapp",
+ "sms"
+ ],
+ "example": "web_widget"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "inbox_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "team_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team",
+ "example": "Support Team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the team",
+ "example": "This is a team of support agents"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team",
+ "example": true
+ }
+ }
+ },
+ "custom_filter_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter",
+ "example": "My Custom Filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter",
+ "example": "conversation"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter",
+ "example": {}
+ }
+ }
+ },
+ "webhook_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The url where the events should be sent",
+ "example": "https://example.com/webhook"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "message_created",
+ "message_updated",
+ "contact_created",
+ "contact_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The events you want to subscribe to.",
+ "example": [
+ "conversation_created",
+ "conversation_status_changed"
+ ]
+ }
+ }
+ },
+ "integrations_hook_create_payload": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "integer",
+ "description": "The ID of app for which integration hook is being created",
+ "example": 1
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "The inbox ID, if the hook is an inbox hook",
+ "example": 1
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "integrations_hook_update_payload": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "automation_rule_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Rule name",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the automation and actions",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created",
+ "description": "The event when you want to execute the automation actions"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support"
+ ]
+ }
+ }
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "query_operator": "OR",
+ "values": [
+ "help"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "portal_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string",
+ "description": "Header color for help-center in hex format",
+ "example": "#FFFFFF"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain to display help center.",
+ "example": "chatwoot.help"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "Help center header",
+ "example": "Handbook"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "link to main dashboard",
+ "example": "https://www.chatwoot.com/"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name for the portal",
+ "example": "Handbook"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal",
+ "example": "Handbook"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Slug for the portal to display in link",
+ "example": "handbook"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Status to check if portal is live",
+ "example": false
+ },
+ "config": {
+ "type": "object",
+ "description": "Configuration about supporting locales",
+ "example": {
+ "allowed_locales": [
+ "en",
+ "es"
+ ],
+ "default_locale": "en"
+ }
+ }
+ }
+ },
+ "category_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the category",
+ "example": "Category Name"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the category",
+ "example": "Category description"
+ },
+ "position": {
+ "type": "integer",
+ "description": "Category position in the portal list to sort",
+ "example": 1
+ },
+ "slug": {
+ "type": "string",
+ "description": "The category slug used in the URL",
+ "example": "category-name"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the category",
+ "example": "en"
+ },
+ "icon": {
+ "type": "string",
+ "description": "The icon of the category as a string (emoji)",
+ "example": "📚"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.",
+ "example": 1
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages",
+ "example": 2
+ }
+ }
+ },
+ "article_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the article",
+ "example": "Article Title"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the article",
+ "example": "article-title"
+ },
+ "position": {
+ "type": "integer",
+ "description": "article position in category",
+ "example": 1
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content.",
+ "example": "This is the content of the article"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the article",
+ "example": "This is the description of the article"
+ },
+ "category_id": {
+ "type": "integer",
+ "description": "The category id of the article",
+ "example": 1
+ },
+ "author_id": {
+ "type": "integer",
+ "description": "The author agent id of the article",
+ "example": 1
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference.",
+ "example": 2
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the article. 0 for draft, 1 for published, 2 for archived",
+ "example": 1
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the article",
+ "example": "en"
+ },
+ "meta": {
+ "type": "object",
+ "description": "Use for search",
+ "example": {
+ "tags": [
+ "article_name"
+ ],
+ "title": "article title",
+ "description": "article description"
+ }
+ }
+ }
+ },
+ "public_contact_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "External identifier of the contact",
+ "example": "1234567890"
+ },
+ "identifier_hash": {
+ "type": "string",
+ "description": "Identifier hash prepared for HMAC authentication",
+ "example": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact",
+ "example": "Alice"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the customer",
+ "example": {}
+ }
+ }
+ },
+ "public_message_create_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Content for the message",
+ "example": "Hello, how can I help you?"
+ },
+ "echo_id": {
+ "type": "string",
+ "description": "Temporary identifier which will be passed back via websockets",
+ "example": "1234567890"
+ }
+ }
+ },
+ "public_message_update_payload": {
+ "type": "object",
+ "properties": {
+ "submitted_values": {
+ "type": "object",
+ "description": "Replies to the Bot Message Types",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the submiitted value",
+ "example": "My Name"
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the submitted value",
+ "example": "My Title"
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the submitted value",
+ "example": "value"
+ },
+ "csat_survey_response": {
+ "type": "object",
+ "description": "The CSAT survey response",
+ "properties": {
+ "feedback_message": {
+ "type": "string",
+ "description": "The feedback message of the CSAT survey response",
+ "example": "Great service!"
+ },
+ "rating": {
+ "type": "integer",
+ "description": "The rating of the CSAT survey response",
+ "example": 5
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "public_conversation_create_payload": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the conversation",
+ "example": {}
+ }
+ }
+ },
+ "extended_contact": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the user"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "online",
+ "offline"
+ ],
+ "description": "Availability status of the user"
+ }
+ }
+ }
+ ]
+ },
+ "contact_base": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ },
+ "contact_list": {
+ "type": "array",
+ "description": "array of contacts",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ }
+ },
+ "contact_conversations": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "display_id": {
+ "type": "number"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "contact_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "conversation_list": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_show": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "conversation_status_toggle": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object"
+ },
+ "payload": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "current_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved"
+ ]
+ },
+ "conversation_id": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "conversation_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "account_summary": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ },
+ "previous": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "agent_conversation_metrics": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "thumbnail": {
+ "type": "string"
+ },
+ "availability": {
+ "type": "string"
+ },
+ "metric": {
+ "type": "object",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "contact_detail": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of entity",
+ "enum": [
+ "contact"
+ ]
+ }
+ }
+ },
+ "message_detailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "description": "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form",
+ "input_csat"
+ ],
+ "description": "The type of the message content"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type",
+ "properties": {
+ "in_reply_to": {
+ "type": "string",
+ "description": "ID of the message this is replying to",
+ "nullable": true
+ }
+ }
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The timestamp when message was created"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flag which shows whether the message is private or not"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message",
+ "nullable": true
+ },
+ "sender": {
+ "$ref": "#/components/schemas/contact_detail"
+ }
+ }
+ },
+ "conversation_meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Labels associated with the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "object",
+ "properties": {
+ "device_name": {
+ "type": "string",
+ "description": "Name of the device"
+ },
+ "browser_name": {
+ "type": "string",
+ "description": "Name of the browser"
+ },
+ "platform_name": {
+ "type": "string",
+ "description": "Name of the platform"
+ },
+ "browser_version": {
+ "type": "string",
+ "description": "Version of the browser"
+ },
+ "platform_version": {
+ "type": "string",
+ "description": "Version of the platform"
+ }
+ }
+ },
+ "referer": {
+ "type": "string",
+ "description": "Referrer URL"
+ },
+ "initiated_at": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "description": "Timestamp when the conversation was initiated"
+ }
+ }
+ },
+ "browser_language": {
+ "type": "string",
+ "description": "Browser language setting"
+ },
+ "conversation_language": {
+ "type": "string",
+ "description": "Conversation language"
+ }
+ },
+ "description": "Additional attributes of the conversation"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact_detail"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the agent last saw the conversation",
+ "nullable": true
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the assignee last saw the conversation",
+ "nullable": true
+ }
+ }
+ },
+ "conversation_messages": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/conversation_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message_detailed"
+ },
+ "description": "List of messages in the conversation"
+ }
+ }
+ },
+ "contact_meta": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer",
+ "description": "Total number of contacts"
+ },
+ "current_page": {
+ "type": "string",
+ "description": "Current page number"
+ }
+ }
+ },
+ "contact_inbox": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source identifier for the contact inbox"
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL for the inbox avatar"
+ },
+ "channel_id": {
+ "type": "integer",
+ "description": "ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "Type of channel"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the inbox",
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "contact_list_item": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the contact",
+ "enum": [
+ "online",
+ "offline"
+ ]
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact",
+ "nullable": true
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity",
+ "nullable": true
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when contact was created"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "description": "List of inboxes associated with this contact",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ }
+ }
+ }
+ },
+ "contacts_list_response": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/contact_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_list_item"
+ },
+ "description": "List of contacts"
+ }
+ }
+ },
+ "contact_show_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/contact_list_item"
+ }
+ }
+ },
+ "contact_conversation_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Content of the message"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "integer",
+ "description": "ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "description": "Type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when message was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "Formatted datetime when message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Whether the message is private"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the message",
+ "nullable": true
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Type of the content"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes of the content"
+ },
+ "sender_type": {
+ "type": "string",
+ "description": "Type of the sender",
+ "nullable": true
+ },
+ "sender_id": {
+ "type": "integer",
+ "description": "ID of the sender",
+ "nullable": true
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "External source IDs"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "Processed message content",
+ "nullable": true
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "Sentiment analysis of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "Conversation details",
+ "properties": {
+ "assignee_id": {
+ "type": "integer",
+ "description": "ID of the assignee",
+ "nullable": true
+ },
+ "unread_count": {
+ "type": "integer",
+ "description": "Count of unread messages"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity"
+ },
+ "contact_inbox": {
+ "type": "object",
+ "description": "Contact inbox details",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the contact inbox"
+ }
+ }
+ }
+ }
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the sender"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "Available name of the sender"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL of the sender's avatar"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Thumbnail URL of the sender"
+ }
+ }
+ }
+ }
+ },
+ "contact_conversations_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "description": "List of conversations for the contact"
+ }
+ }
+ },
+ "contactable_inboxes_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ },
+ "description": "List of contactable inboxes for the contact"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "account_id": {
+ "in": "path",
+ "name": "account_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the account"
+ },
+ "agent_bot_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agentbot to be updated"
+ },
+ "team_id": {
+ "in": "path",
+ "name": "team_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the team to be updated"
+ },
+ "inbox_id": {
+ "in": "path",
+ "name": "inbox_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the Inbox"
+ },
+ "hook_id": {
+ "in": "path",
+ "name": "hook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the integration hook"
+ },
+ "source_id": {
+ "in": "path",
+ "name": "source_id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ },
+ "contact_sort_param": {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "name",
+ "email",
+ "phone_number",
+ "last_activity_at",
+ "-name",
+ "-email",
+ "-phone_number",
+ "-last_activity_at"
+ ]
+ },
+ "required": false,
+ "description": "The attribute by which list should be sorted"
+ },
+ "conversation_id": {
+ "in": "path",
+ "name": "conversation_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the conversation"
+ },
+ "conversation_uuid": {
+ "in": "path",
+ "name": "conversation_uuid",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The uuid of the conversation"
+ },
+ "custom_filter_id": {
+ "in": "path",
+ "name": "custom_filter_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the custom filter"
+ },
+ "webhook_id": {
+ "in": "path",
+ "name": "webhook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the webhook"
+ },
+ "message_id": {
+ "in": "path",
+ "name": "message_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the message"
+ },
+ "page": {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": false,
+ "description": "The page parameter"
+ },
+ "platform_user_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the user on the platform"
+ },
+ "report_type": {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account",
+ "agent",
+ "inbox",
+ "label",
+ "team"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ "report_metric": {
+ "in": "query",
+ "name": "metric",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversations_count",
+ "incoming_messages_count",
+ "outgoing_messages_count",
+ "avg_first_response_time",
+ "avg_resolution_time",
+ "resolutions_count"
+ ]
+ },
+ "required": true,
+ "description": "The type of metric"
+ },
+ "public_inbox_identifier": {
+ "in": "path",
+ "name": "inbox_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The identifier obtained from API inbox channel"
+ },
+ "public_contact_identifier": {
+ "in": "path",
+ "name": "contact_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The source id of contact obtained on contact create"
+ },
+ "portal_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The slug identifier of the portal"
+ }
+ },
+ "securitySchemes": {
+ "userApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
+ },
+ "agentBotApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
+ },
+ "platformAppApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
+ }
+ }
+ },
+ "tags": [
+ {
+ "name": "Contacts API",
+ "description": "Public contact APIs"
+ },
+ {
+ "name": "Conversations API",
+ "description": "Public conversation APIs"
+ },
+ {
+ "name": "Messages API",
+ "description": "Public message APIs"
+ }
+ ],
+ "x-tagGroups": [
+ {
+ "name": "Platform",
+ "tags": [
+ "Accounts",
+ "Account Users",
+ "AgentBots",
+ "Users"
+ ]
+ },
+ {
+ "name": "Application",
+ "tags": [
+ "Account AgentBots",
+ "Agents",
+ "Canned Responses",
+ "Contacts",
+ "Contact Labels",
+ "Conversation Assignments",
+ "Conversation Labels",
+ "Conversations",
+ "Custom Attributes",
+ "Custom Filters",
+ "Inboxes",
+ "Integrations",
+ "Messages",
+ "Profile",
+ "Reports",
+ "Teams",
+ "Webhooks",
+ "Automation Rule",
+ "Help Center"
+ ]
+ },
+ {
+ "name": "Client",
+ "tags": [
+ "Contacts API",
+ "Conversations API",
+ "Messages API"
+ ]
+ },
+ {
+ "name": "Others",
+ "tags": [
+ "CSAT Survey Page"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/swagger/tag_groups/other_swagger.json b/swagger/tag_groups/other_swagger.json
new file mode 100644
index 000000000..fc61e8721
--- /dev/null
+++ b/swagger/tag_groups/other_swagger.json
@@ -0,0 +1,4370 @@
+{
+ "openapi": "3.0.4",
+ "info": {
+ "title": "Chatwoot",
+ "description": "This is the API documentation for Chatwoot server.",
+ "version": "1.1.0",
+ "termsOfService": "https://www.chatwoot.com/terms-of-service/",
+ "contact": {
+ "email": "hello@chatwoot.com"
+ },
+ "license": {
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://app.chatwoot.com/"
+ }
+ ],
+ "paths": {
+ "/survey/responses/{conversation_uuid}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/conversation_uuid"
+ }
+ ],
+ "get": {
+ "tags": [
+ "CSAT Survey Page"
+ ],
+ "operationId": "get-csat-survey-page",
+ "summary": "Get CSAT survey page",
+ "description": "You can redirect the client to this URL, instead of implementing the CSAT survey component yourself.",
+ "security": [],
+ "responses": {
+ "200": {
+ "description": "Success"
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "bad_request_error": {
+ "title": "data",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/request_error"
+ }
+ }
+ }
+ },
+ "request_error": {
+ "type": "object",
+ "properties": {
+ "field": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ }
+ },
+ "generic_id": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ }
+ }
+ },
+ "canned_response": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the canned response"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response"
+ },
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was updated"
+ }
+ }
+ },
+ "custom_attribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Identifier"
+ },
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name"
+ },
+ "attribute_display_type": {
+ "type": "string",
+ "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value"
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue"
+ },
+ "attribute_values": {
+ "type": "string",
+ "description": "Attribute values"
+ },
+ "attribute_model": {
+ "type": "string",
+ "description": "Attribute type(conversation_attribute/contact_attribute)"
+ },
+ "default_value": {
+ "type": "string",
+ "description": "Attribute default value"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was updated"
+ }
+ }
+ },
+ "automation_rule": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Response payload that contains automation rule(s)",
+ "oneOf": [
+ {
+ "type": "array",
+ "description": "Array of automation rules (for listing endpoint)",
+ "items": {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ },
+ {
+ "type": "object",
+ "description": "Single automation rule (for show/create/update endpoints)",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "automation_rule_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the automation rule"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the rule",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to give more context about the rule",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created"
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation/message filter would work",
+ "items": {
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attribute_key": {
+ "type": "string"
+ },
+ "query_operator": {
+ "type": "string"
+ },
+ "filter_operator": {
+ "type": "string"
+ }
+ },
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "values": [
+ "help"
+ ],
+ "query_operator": "and"
+ }
+ }
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which we perform when condition matches",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action_name": {
+ "type": "string"
+ },
+ "action_params": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support",
+ "sales"
+ ]
+ }
+ }
+ },
+ "created_on": {
+ "type": "integer",
+ "description": "The timestamp when the rule was created"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ }
+ }
+ },
+ "portal": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ }
+ },
+ "portal_single": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ },
+ "portal_config": {
+ "type": "object",
+ "description": "Configuration settings for the portal",
+ "properties": {
+ "allowed_locales": {
+ "type": "array",
+ "description": "List of allowed locales for the portal",
+ "items": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The language code"
+ },
+ "articles_count": {
+ "type": "integer",
+ "description": "Number of articles in this locale"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories in this locale"
+ }
+ }
+ }
+ }
+ }
+ },
+ "portal_logo": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the logo file"
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "ID of the portal this logo belongs to"
+ },
+ "file_type": {
+ "type": "string",
+ "description": "MIME type of the file"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "file_url": {
+ "type": "string",
+ "description": "URL to access the logo file"
+ },
+ "blob_id": {
+ "type": "integer",
+ "description": "ID of the blob"
+ },
+ "filename": {
+ "type": "string",
+ "description": "Name of the file"
+ }
+ }
+ },
+ "portal_meta": {
+ "type": "object",
+ "properties": {
+ "all_articles_count": {
+ "type": "integer",
+ "description": "Total number of articles"
+ },
+ "archived_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of archived articles"
+ },
+ "published_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of published articles"
+ },
+ "draft_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of draft articles"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories"
+ },
+ "default_locale": {
+ "type": "string",
+ "description": "Default locale for the portal"
+ }
+ }
+ },
+ "portal_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the portal"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Whether the portal is archived"
+ },
+ "color": {
+ "type": "string",
+ "description": "The color code for the portal"
+ },
+ "config": {
+ "$ref": "#/components/schemas/portal_config"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain for the portal"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "The header text for the portal"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "Homepage link for the portal"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the portal"
+ },
+ "slug": {
+ "type": "string",
+ "description": "URL slug for the portal"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ },
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
+ }
+ }
+ },
+ "category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "locale": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
+ }
+ }
+ },
+ "article": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "meta": {
+ "type": "object"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "status": {
+ "type": "integer",
+ "enum": [
+ "draft",
+ "published",
+ "archived"
+ ]
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "views": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "author_id": {
+ "type": "integer"
+ },
+ "category_id": {
+ "type": "integer"
+ },
+ "folder_id": {
+ "type": "integer"
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference."
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact",
+ "example": {
+ "attribute_key": "attribute_value",
+ "signed_up_at": "dd/mm/yyyy"
+ }
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "The last activity at of the contact"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The created at of the contact"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "uuid": {
+ "type": "string",
+ "description": "UUID of the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the conversation"
+ },
+ "agent_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the agent"
+ },
+ "assignee_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the assignee"
+ },
+ "can_reply": {
+ "type": "boolean",
+ "description": "Whether the conversation can be replied to"
+ },
+ "contact_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels of the conversation"
+ },
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the conversation is muted"
+ },
+ "snoozed_until": {
+ "type": "number",
+ "description": "The time at which the conversation will be unmuted"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The time at which conversation was created"
+ },
+ "updated_at": {
+ "type": "number",
+ "description": "The time at which conversation was updated"
+ },
+ "timestamp": {
+ "type": "string",
+ "description": "The time at which conversation was created"
+ },
+ "first_reply_created_at": {
+ "type": "number",
+ "description": "The time at which the first reply was created"
+ },
+ "unread_count": {
+ "type": "number",
+ "description": "The number of unread messages"
+ },
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the conversation"
+ },
+ "priority": {
+ "type": "string",
+ "description": "The priority of the conversation"
+ },
+ "waiting_since": {
+ "type": "number",
+ "description": "The time at which the conversation was waiting"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy"
+ },
+ "applied_sla": {
+ "type": "object",
+ "description": "The applied SLA"
+ },
+ "sla_events": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "SLA event objects"
+ }
+ }
+ }
+ },
+ "message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "description": "The type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The time at which message was created"
+ },
+ "updated_at": {
+ "type": "integer",
+ "description": "The time at which message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flags which shows whether the message is private or not"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form"
+ ],
+ "description": "The type of the template message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type"
+ },
+ "sender_type": {
+ "type": "string",
+ "enum": [
+ "contact",
+ "agent",
+ "agent_bot"
+ ],
+ "description": "The type of the sender"
+ },
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "The external source IDs of the message"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "The processed message content"
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "The sentiment of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "The conversation object"
+ },
+ "attachment": {
+ "type": "object",
+ "description": "The file object attached to the image"
+ },
+ "sender": {
+ "type": "object",
+ "description": "User/Agent/AgentBot object"
+ }
+ }
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "access_token": {
+ "type": "string"
+ },
+ "account_id": {
+ "type": "number"
+ },
+ "available_name": {
+ "type": "string"
+ },
+ "avatar_url": {
+ "type": "string"
+ },
+ "confirmed": {
+ "type": "boolean"
+ },
+ "display_name": {
+ "type": "string",
+ "nullable": true
+ },
+ "message_signature": {
+ "type": "string",
+ "nullable": true
+ },
+ "email": {
+ "type": "string"
+ },
+ "hmac_identifier": {
+ "type": "string"
+ },
+ "inviter_id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "pubsub_token": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ]
+ },
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Available for users who are created through platform APIs and has custom attributes associated."
+ },
+ "accounts": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "active_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ]
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "availability": {
+ "type": "string"
+ },
+ "availability_status": {
+ "type": "string"
+ },
+ "auto_offline": {
+ "type": "boolean"
+ },
+ "custom_role_id": {
+ "type": "number",
+ "nullable": true
+ },
+ "custom_role": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "agent": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent computed by Chatwoot."
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away."
+ },
+ "confirmed": {
+ "type": "boolean",
+ "description": "Whether the agent has confirmed their email address."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the agent"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "The available name of the agent"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "The role of the agent"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent"
+ },
+ "custom_role_id": {
+ "type": "integer",
+ "description": "The custom role id of the agent"
+ }
+ }
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "Website URL"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "Widget Color used for customization of the widget"
+ },
+ "website_token": {
+ "type": "string",
+ "description": "Website Token"
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "The flag which shows whether Auto Assignment is enabled or not"
+ },
+ "web_widget_script": {
+ "type": "string",
+ "description": "Script used to load the website widget"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether greeting is enabled"
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "A greeting message when the user starts the conversation"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "ID of the channel this inbox belongs to"
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether working hours feature is enabled"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "The flag to enable collecting email from contacts"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "The flag to enable CSAT survey"
+ },
+ "auto_assignment_config": {
+ "type": "object",
+ "description": "Configuration settings for auto assignment"
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Message to show when agents are out of office"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "Configuration for working hours of the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "number",
+ "description": "Day of the week (0-6, where 0 is Sunday)"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is closed for the entire day"
+ },
+ "open_hour": {
+ "type": "number",
+ "description": "Hour when inbox opens (0-23)"
+ },
+ "open_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox opens (0-59)"
+ },
+ "close_hour": {
+ "type": "number",
+ "description": "Hour when inbox closes (0-23)"
+ },
+ "close_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox closes (0-59)"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is open for the entire day"
+ }
+ }
+ }
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone configuration for the inbox"
+ },
+ "callback_webhook_url": {
+ "type": "string",
+ "description": "Webhook URL for callbacks"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Whether to allow messages after a conversation is resolved"
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Whether to lock a contact to a single conversation"
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Type of sender name to display (e.g., friendly)"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name associated with the inbox"
+ },
+ "hmac_mandatory": {
+ "type": "boolean",
+ "description": "Whether HMAC verification is mandatory"
+ },
+ "selected_feature_flags": {
+ "type": "object",
+ "description": "Selected feature flags for the inbox"
+ },
+ "reply_time": {
+ "type": "string",
+ "description": "Expected reply time"
+ },
+ "messaging_service_sid": {
+ "type": "string",
+ "description": "Messaging service SID for SMS providers"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number associated with the inbox"
+ },
+ "medium": {
+ "type": "string",
+ "description": "Medium of communication (e.g., sms, email)"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the channel"
+ }
+ }
+ },
+ "inbox_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "The ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "provider": {
+ "type": "string",
+ "description": "The provider of the inbox"
+ }
+ }
+ },
+ "agent_bot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the agent bot"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the agent bot"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot"
+ },
+ "bot_type": {
+ "type": "string",
+ "description": "The type of the bot"
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration of the bot"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account ID if it's an account specific bot"
+ },
+ "access_token": {
+ "type": "string",
+ "description": "The access token for the bot"
+ },
+ "system_bot": {
+ "type": "boolean",
+ "description": "Whether the bot is a system bot"
+ }
+ }
+ },
+ "contact_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox_contact"
+ }
+ }
+ },
+ "contactable_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ },
+ "custom_filter": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the custom filter"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was updated"
+ }
+ }
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the webhook"
+ },
+ "url": {
+ "type": "string",
+ "description": "The url to which the events will be send"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "contact_created",
+ "contact_updated",
+ "message_created",
+ "message_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The list of subscribed events"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The id of the account which the webhook object belongs to"
+ }
+ }
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ],
+ "description": "The user role in the account"
+ }
+ }
+ },
+ "account_user": {
+ "type": "array",
+ "description": "Array of account users",
+ "items": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
+ }
+ },
+ "platform_account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ }
+ }
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account with the team is a part of"
+ },
+ "is_member": {
+ "type": "boolean",
+ "description": "This field shows whether the current user is a part of the team"
+ }
+ }
+ },
+ "integrations_app": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the integration"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "hook_type": {
+ "type": "string",
+ "description": "Whether the integration is an account or inbox integration"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the integration is enabled for the account"
+ },
+ "allow_multiple_hooks": {
+ "type": "boolean",
+ "description": "Whether multiple hooks can be created for the integration"
+ },
+ "hooks": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "If there are any hooks created for this integration"
+ }
+ }
+ },
+ "integrations_hook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration hook"
+ },
+ "app_id": {
+ "type": "string",
+ "description": "The ID of the integration app"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "Inbox ID if its an Inbox integration"
+ },
+ "account_id": {
+ "type": "string",
+ "description": "Account ID of the integration"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Whether the integration hook is enabled for the account"
+ },
+ "hook_type": {
+ "type": "boolean",
+ "description": "Whether its an account or inbox integration hook"
+ },
+ "settings": {
+ "type": "object",
+ "description": "The associated settings for the integration"
+ }
+ }
+ },
+ "public_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the contact"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The session identifier of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact"
+ },
+ "pubsub_token": {
+ "type": "string",
+ "description": "The token to be used to connect to chatwoot websocket"
+ }
+ }
+ },
+ "public_conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the conversation"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "The inbox id of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ },
+ "description": "Messages in the conversation"
+ },
+ "contact": {
+ "type": "object",
+ "description": "The contact information associated to the conversation"
+ }
+ }
+ },
+ "public_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Text content of the message"
+ },
+ "message_type": {
+ "type": "string",
+ "description": "Denotes the message type"
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Content type of the message"
+ },
+ "content_attributes": {
+ "type": "string",
+ "description": "Additional content attributes of the message"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Created at time stamp of the message"
+ },
+ "conversation_id": {
+ "type": "string",
+ "description": "Conversation Id of the message"
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "Attachments if any"
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender"
+ }
+ }
+ },
+ "public_inbox": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "Inbox identifier"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone defined on the inbox"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "The working hours defined on the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "integer",
+ "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is open the whole day"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is closed the whole day"
+ },
+ "open_hour": {
+ "type": "integer",
+ "description": "Opening hour. Can be null if closed all day"
+ },
+ "open_minutes": {
+ "type": "integer",
+ "description": "Opening minute. Can be null if closed all day"
+ },
+ "close_hour": {
+ "type": "integer",
+ "description": "Closing hour. Can be null if closed all day"
+ },
+ "close_minutes": {
+ "type": "integer",
+ "description": "Closing minute. Can be null if closed all day"
+ }
+ }
+ }
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the working hours are enabled on the inbox"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Greeting Message is enabled on the inbox"
+ },
+ "identity_validation_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the User Identity Validation is enforced on the inbox"
+ }
+ }
+ },
+ "account_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the account",
+ "example": "My Account"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the account",
+ "example": "en"
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain of the account",
+ "example": "example.com"
+ },
+ "support_email": {
+ "type": "string",
+ "description": "The support email of the account",
+ "example": "support@example.com"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "active",
+ "suspended"
+ ],
+ "description": "The status of the account",
+ "example": "active"
+ },
+ "limits": {
+ "type": "object",
+ "description": "The limits of the account",
+ "example": {}
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the account",
+ "example": {}
+ }
+ }
+ },
+ "account_user_create_update_payload": {
+ "type": "object",
+ "required": [
+ "user_id",
+ "role"
+ ],
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user",
+ "example": 1
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent",
+ "example": "administrator"
+ }
+ }
+ },
+ "platform_agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "The account ID to associate the agent bot with",
+ "example": 1
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ }
+ }
+ },
+ "agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "bot_type": {
+ "type": "integer",
+ "description": "The type of the bot (0 for webhook)",
+ "example": 0
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration for the bot",
+ "example": {}
+ }
+ }
+ },
+ "user_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the user",
+ "example": "Daniel"
+ },
+ "display_name": {
+ "type": "string",
+ "description": "Display name of the user",
+ "example": "Dan"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the user",
+ "example": "daniel@acme.inc"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password must contain uppercase, lowercase letters, number and a special character",
+ "example": "Password2!"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes you want to associate with the user",
+ "example": {}
+ }
+ }
+ },
+ "canned_response_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response",
+ "example": "Hello, {{contact.name}}! Welcome to our service."
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response",
+ "example": "welcome"
+ }
+ }
+ },
+ "custom_attribute_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name",
+ "example": "Custom Attribute"
+ },
+ "attribute_display_type": {
+ "type": "integer",
+ "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)",
+ "example": 0
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description",
+ "example": "This is a custom attribute"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value",
+ "example": "custom_attribute"
+ },
+ "attribute_values": {
+ "type": "array",
+ "description": "Attribute values",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "value1",
+ "value2"
+ ]
+ },
+ "attribute_model": {
+ "type": "integer",
+ "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)",
+ "example": 0
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).",
+ "example": "^[a-zA-Z0-9]+$"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.",
+ "example": "Please enter a valid value"
+ }
+ }
+ },
+ "agent_create_payload": {
+ "type": "object",
+ "required": [
+ "name",
+ "email",
+ "role"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Full Name of the agent",
+ "example": "John Doe"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the Agent",
+ "example": "john.doe@acme.inc"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability setting of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "agent_update_payload": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "contact_create_payload": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox to which the contact belongs",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "contact_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "conversation_create_payload": {
+ "type": "object",
+ "required": [
+ "source_id",
+ "inbox_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Conversation source id",
+ "example": "1234567890"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email",
+ "example": 1
+ },
+ "contact_id": {
+ "type": "integer",
+ "description": "Contact Id for which conversation is created",
+ "example": 1
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Lets you specify attributes like browser information",
+ "example": {
+ "browser": "Chrome",
+ "browser_version": "89.0.4389.82",
+ "os": "Windows",
+ "os_version": "10"
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
+ "example": {
+ "attribute_key": "attribute_value",
+ "priority_conversation_number": 3
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "Specify the conversation whether it's pending, open, closed",
+ "example": "open"
+ },
+ "assignee_id": {
+ "type": "integer",
+ "description": "Agent Id for assigning a conversation to an agent",
+ "example": 1
+ },
+ "team_id": {
+ "type": "integer",
+ "description": "Team Id for assigning a conversation to a team\\",
+ "example": 1
+ },
+ "snoozed_until": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Snoozed until date time",
+ "example": "2030-07-21T17:32:28Z"
+ },
+ "message": {
+ "type": "object",
+ "description": "The initial message to be sent to the conversation",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_message_create_payload": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "message_type": {
+ "type": "string",
+ "enum": [
+ "outgoing",
+ "incoming"
+ ],
+ "description": "The type of the message",
+ "example": "outgoing"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Flag to identify if it is a private note",
+ "example": false
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_email",
+ "cards",
+ "input_select",
+ "form",
+ "article"
+ ],
+ "description": "Content type of the message",
+ "example": "text"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes based on the content type",
+ "example": {}
+ },
+ "campaign_id": {
+ "type": "integer",
+ "description": "The campaign id to which the message belongs",
+ "example": 1
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ },
+ "inbox_create_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the channel",
+ "enum": [
+ "web_widget",
+ "api",
+ "email",
+ "line",
+ "telegram",
+ "whatsapp",
+ "sms"
+ ],
+ "example": "web_widget"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "inbox_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "team_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team",
+ "example": "Support Team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the team",
+ "example": "This is a team of support agents"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team",
+ "example": true
+ }
+ }
+ },
+ "custom_filter_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter",
+ "example": "My Custom Filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter",
+ "example": "conversation"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter",
+ "example": {}
+ }
+ }
+ },
+ "webhook_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The url where the events should be sent",
+ "example": "https://example.com/webhook"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "message_created",
+ "message_updated",
+ "contact_created",
+ "contact_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The events you want to subscribe to.",
+ "example": [
+ "conversation_created",
+ "conversation_status_changed"
+ ]
+ }
+ }
+ },
+ "integrations_hook_create_payload": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "integer",
+ "description": "The ID of app for which integration hook is being created",
+ "example": 1
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "The inbox ID, if the hook is an inbox hook",
+ "example": 1
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "integrations_hook_update_payload": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "automation_rule_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Rule name",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the automation and actions",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created",
+ "description": "The event when you want to execute the automation actions"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support"
+ ]
+ }
+ }
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "query_operator": "OR",
+ "values": [
+ "help"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "portal_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string",
+ "description": "Header color for help-center in hex format",
+ "example": "#FFFFFF"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain to display help center.",
+ "example": "chatwoot.help"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "Help center header",
+ "example": "Handbook"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "link to main dashboard",
+ "example": "https://www.chatwoot.com/"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name for the portal",
+ "example": "Handbook"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal",
+ "example": "Handbook"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Slug for the portal to display in link",
+ "example": "handbook"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Status to check if portal is live",
+ "example": false
+ },
+ "config": {
+ "type": "object",
+ "description": "Configuration about supporting locales",
+ "example": {
+ "allowed_locales": [
+ "en",
+ "es"
+ ],
+ "default_locale": "en"
+ }
+ }
+ }
+ },
+ "category_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the category",
+ "example": "Category Name"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the category",
+ "example": "Category description"
+ },
+ "position": {
+ "type": "integer",
+ "description": "Category position in the portal list to sort",
+ "example": 1
+ },
+ "slug": {
+ "type": "string",
+ "description": "The category slug used in the URL",
+ "example": "category-name"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the category",
+ "example": "en"
+ },
+ "icon": {
+ "type": "string",
+ "description": "The icon of the category as a string (emoji)",
+ "example": "📚"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.",
+ "example": 1
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages",
+ "example": 2
+ }
+ }
+ },
+ "article_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the article",
+ "example": "Article Title"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the article",
+ "example": "article-title"
+ },
+ "position": {
+ "type": "integer",
+ "description": "article position in category",
+ "example": 1
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content.",
+ "example": "This is the content of the article"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the article",
+ "example": "This is the description of the article"
+ },
+ "category_id": {
+ "type": "integer",
+ "description": "The category id of the article",
+ "example": 1
+ },
+ "author_id": {
+ "type": "integer",
+ "description": "The author agent id of the article",
+ "example": 1
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference.",
+ "example": 2
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the article. 0 for draft, 1 for published, 2 for archived",
+ "example": 1
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the article",
+ "example": "en"
+ },
+ "meta": {
+ "type": "object",
+ "description": "Use for search",
+ "example": {
+ "tags": [
+ "article_name"
+ ],
+ "title": "article title",
+ "description": "article description"
+ }
+ }
+ }
+ },
+ "public_contact_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "External identifier of the contact",
+ "example": "1234567890"
+ },
+ "identifier_hash": {
+ "type": "string",
+ "description": "Identifier hash prepared for HMAC authentication",
+ "example": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact",
+ "example": "Alice"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the customer",
+ "example": {}
+ }
+ }
+ },
+ "public_message_create_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Content for the message",
+ "example": "Hello, how can I help you?"
+ },
+ "echo_id": {
+ "type": "string",
+ "description": "Temporary identifier which will be passed back via websockets",
+ "example": "1234567890"
+ }
+ }
+ },
+ "public_message_update_payload": {
+ "type": "object",
+ "properties": {
+ "submitted_values": {
+ "type": "object",
+ "description": "Replies to the Bot Message Types",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the submiitted value",
+ "example": "My Name"
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the submitted value",
+ "example": "My Title"
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the submitted value",
+ "example": "value"
+ },
+ "csat_survey_response": {
+ "type": "object",
+ "description": "The CSAT survey response",
+ "properties": {
+ "feedback_message": {
+ "type": "string",
+ "description": "The feedback message of the CSAT survey response",
+ "example": "Great service!"
+ },
+ "rating": {
+ "type": "integer",
+ "description": "The rating of the CSAT survey response",
+ "example": 5
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "public_conversation_create_payload": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the conversation",
+ "example": {}
+ }
+ }
+ },
+ "extended_contact": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the user"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "online",
+ "offline"
+ ],
+ "description": "Availability status of the user"
+ }
+ }
+ }
+ ]
+ },
+ "contact_base": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ },
+ "contact_list": {
+ "type": "array",
+ "description": "array of contacts",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ }
+ },
+ "contact_conversations": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "display_id": {
+ "type": "number"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "contact_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "conversation_list": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_show": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "conversation_status_toggle": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object"
+ },
+ "payload": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "current_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved"
+ ]
+ },
+ "conversation_id": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "conversation_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "account_summary": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ },
+ "previous": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "agent_conversation_metrics": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "thumbnail": {
+ "type": "string"
+ },
+ "availability": {
+ "type": "string"
+ },
+ "metric": {
+ "type": "object",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "contact_detail": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of entity",
+ "enum": [
+ "contact"
+ ]
+ }
+ }
+ },
+ "message_detailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "description": "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form",
+ "input_csat"
+ ],
+ "description": "The type of the message content"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type",
+ "properties": {
+ "in_reply_to": {
+ "type": "string",
+ "description": "ID of the message this is replying to",
+ "nullable": true
+ }
+ }
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The timestamp when message was created"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flag which shows whether the message is private or not"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message",
+ "nullable": true
+ },
+ "sender": {
+ "$ref": "#/components/schemas/contact_detail"
+ }
+ }
+ },
+ "conversation_meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Labels associated with the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "object",
+ "properties": {
+ "device_name": {
+ "type": "string",
+ "description": "Name of the device"
+ },
+ "browser_name": {
+ "type": "string",
+ "description": "Name of the browser"
+ },
+ "platform_name": {
+ "type": "string",
+ "description": "Name of the platform"
+ },
+ "browser_version": {
+ "type": "string",
+ "description": "Version of the browser"
+ },
+ "platform_version": {
+ "type": "string",
+ "description": "Version of the platform"
+ }
+ }
+ },
+ "referer": {
+ "type": "string",
+ "description": "Referrer URL"
+ },
+ "initiated_at": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "description": "Timestamp when the conversation was initiated"
+ }
+ }
+ },
+ "browser_language": {
+ "type": "string",
+ "description": "Browser language setting"
+ },
+ "conversation_language": {
+ "type": "string",
+ "description": "Conversation language"
+ }
+ },
+ "description": "Additional attributes of the conversation"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact_detail"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the agent last saw the conversation",
+ "nullable": true
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the assignee last saw the conversation",
+ "nullable": true
+ }
+ }
+ },
+ "conversation_messages": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/conversation_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message_detailed"
+ },
+ "description": "List of messages in the conversation"
+ }
+ }
+ },
+ "contact_meta": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer",
+ "description": "Total number of contacts"
+ },
+ "current_page": {
+ "type": "string",
+ "description": "Current page number"
+ }
+ }
+ },
+ "contact_inbox": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source identifier for the contact inbox"
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL for the inbox avatar"
+ },
+ "channel_id": {
+ "type": "integer",
+ "description": "ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "Type of channel"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the inbox",
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "contact_list_item": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the contact",
+ "enum": [
+ "online",
+ "offline"
+ ]
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact",
+ "nullable": true
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity",
+ "nullable": true
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when contact was created"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "description": "List of inboxes associated with this contact",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ }
+ }
+ }
+ },
+ "contacts_list_response": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/contact_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_list_item"
+ },
+ "description": "List of contacts"
+ }
+ }
+ },
+ "contact_show_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/contact_list_item"
+ }
+ }
+ },
+ "contact_conversation_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Content of the message"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "integer",
+ "description": "ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "description": "Type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when message was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "Formatted datetime when message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Whether the message is private"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the message",
+ "nullable": true
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Type of the content"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes of the content"
+ },
+ "sender_type": {
+ "type": "string",
+ "description": "Type of the sender",
+ "nullable": true
+ },
+ "sender_id": {
+ "type": "integer",
+ "description": "ID of the sender",
+ "nullable": true
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "External source IDs"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "Processed message content",
+ "nullable": true
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "Sentiment analysis of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "Conversation details",
+ "properties": {
+ "assignee_id": {
+ "type": "integer",
+ "description": "ID of the assignee",
+ "nullable": true
+ },
+ "unread_count": {
+ "type": "integer",
+ "description": "Count of unread messages"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity"
+ },
+ "contact_inbox": {
+ "type": "object",
+ "description": "Contact inbox details",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the contact inbox"
+ }
+ }
+ }
+ }
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the sender"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "Available name of the sender"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL of the sender's avatar"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Thumbnail URL of the sender"
+ }
+ }
+ }
+ }
+ },
+ "contact_conversations_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "description": "List of conversations for the contact"
+ }
+ }
+ },
+ "contactable_inboxes_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ },
+ "description": "List of contactable inboxes for the contact"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "account_id": {
+ "in": "path",
+ "name": "account_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the account"
+ },
+ "agent_bot_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agentbot to be updated"
+ },
+ "team_id": {
+ "in": "path",
+ "name": "team_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the team to be updated"
+ },
+ "inbox_id": {
+ "in": "path",
+ "name": "inbox_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the Inbox"
+ },
+ "hook_id": {
+ "in": "path",
+ "name": "hook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the integration hook"
+ },
+ "source_id": {
+ "in": "path",
+ "name": "source_id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ },
+ "contact_sort_param": {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "name",
+ "email",
+ "phone_number",
+ "last_activity_at",
+ "-name",
+ "-email",
+ "-phone_number",
+ "-last_activity_at"
+ ]
+ },
+ "required": false,
+ "description": "The attribute by which list should be sorted"
+ },
+ "conversation_id": {
+ "in": "path",
+ "name": "conversation_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the conversation"
+ },
+ "conversation_uuid": {
+ "in": "path",
+ "name": "conversation_uuid",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The uuid of the conversation"
+ },
+ "custom_filter_id": {
+ "in": "path",
+ "name": "custom_filter_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the custom filter"
+ },
+ "webhook_id": {
+ "in": "path",
+ "name": "webhook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the webhook"
+ },
+ "message_id": {
+ "in": "path",
+ "name": "message_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the message"
+ },
+ "page": {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": false,
+ "description": "The page parameter"
+ },
+ "platform_user_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the user on the platform"
+ },
+ "report_type": {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account",
+ "agent",
+ "inbox",
+ "label",
+ "team"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ "report_metric": {
+ "in": "query",
+ "name": "metric",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversations_count",
+ "incoming_messages_count",
+ "outgoing_messages_count",
+ "avg_first_response_time",
+ "avg_resolution_time",
+ "resolutions_count"
+ ]
+ },
+ "required": true,
+ "description": "The type of metric"
+ },
+ "public_inbox_identifier": {
+ "in": "path",
+ "name": "inbox_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The identifier obtained from API inbox channel"
+ },
+ "public_contact_identifier": {
+ "in": "path",
+ "name": "contact_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The source id of contact obtained on contact create"
+ },
+ "portal_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The slug identifier of the portal"
+ }
+ },
+ "securitySchemes": {
+ "userApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
+ },
+ "agentBotApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
+ },
+ "platformAppApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
+ }
+ }
+ },
+ "tags": [
+ {
+ "name": "CSAT Survey Page",
+ "description": "Customer satisfaction survey"
+ }
+ ],
+ "x-tagGroups": [
+ {
+ "name": "Platform",
+ "tags": [
+ "Accounts",
+ "Account Users",
+ "AgentBots",
+ "Users"
+ ]
+ },
+ {
+ "name": "Application",
+ "tags": [
+ "Account AgentBots",
+ "Agents",
+ "Canned Responses",
+ "Contacts",
+ "Contact Labels",
+ "Conversation Assignments",
+ "Conversation Labels",
+ "Conversations",
+ "Custom Attributes",
+ "Custom Filters",
+ "Inboxes",
+ "Integrations",
+ "Messages",
+ "Profile",
+ "Reports",
+ "Teams",
+ "Webhooks",
+ "Automation Rule",
+ "Help Center"
+ ]
+ },
+ {
+ "name": "Client",
+ "tags": [
+ "Contacts API",
+ "Conversations API",
+ "Messages API"
+ ]
+ },
+ {
+ "name": "Others",
+ "tags": [
+ "CSAT Survey Page"
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/swagger/tag_groups/others.yml b/swagger/tag_groups/others.yml
new file mode 100644
index 000000000..08219959c
--- /dev/null
+++ b/swagger/tag_groups/others.yml
@@ -0,0 +1,29 @@
+openapi: '3.0.4'
+info:
+ title: Chatwoot - Other APIs
+ description: Other API endpoints for Chatwoot
+ version: 1.1.0
+ termsOfService: https://www.chatwoot.com/terms-of-service/
+ contact:
+ email: hello@chatwoot.com
+ license:
+ name: MIT License
+ url: https://opensource.org/licenses/MIT
+servers:
+ - url: https://app.chatwoot.com/
+tags:
+ - name: CSAT Survey Page
+ description: APIs for CSAT survey functionality
+paths:
+ $ref: ../paths/index.yml
+components:
+ schemas:
+ $ref: ../definitions/index.yml
+ parameters:
+ $ref: ../parameters/index.yml
+ securitySchemes:
+ userApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
\ No newline at end of file
diff --git a/swagger/tag_groups/platform.yml b/swagger/tag_groups/platform.yml
new file mode 100644
index 000000000..139dd741e
--- /dev/null
+++ b/swagger/tag_groups/platform.yml
@@ -0,0 +1,40 @@
+openapi: '3.0.4'
+info:
+ title: Chatwoot - Platform API
+ description: Platform API endpoints for Chatwoot
+ version: 1.1.0
+ termsOfService: https://www.chatwoot.com/terms-of-service/
+ contact:
+ email: hello@chatwoot.com
+ license:
+ name: MIT License
+ url: https://opensource.org/licenses/MIT
+servers:
+ - url: https://app.chatwoot.com/
+tags:
+ - name: Accounts
+ description: Platform account management
+ - name: Account Users
+ description: Manage users within platform accounts
+ - name: AgentBots
+ description: Manage agent bots on the platform
+ - name: Users
+ description: Platform user management
+paths:
+ $ref: ../paths/index.yml
+components:
+ schemas:
+ $ref: ../definitions/index.yml
+ parameters:
+ $ref: ../parameters/index.yml
+ securitySchemes:
+ userApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels.
+ platformAppApiKey:
+ type: apiKey
+ in: header
+ name: api_access_token
+ description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles.
\ No newline at end of file
diff --git a/swagger/tag_groups/platform_swagger.json b/swagger/tag_groups/platform_swagger.json
new file mode 100644
index 000000000..18ec796a0
--- /dev/null
+++ b/swagger/tag_groups/platform_swagger.json
@@ -0,0 +1,5143 @@
+{
+ "openapi": "3.0.4",
+ "info": {
+ "title": "Chatwoot",
+ "description": "This is the API documentation for Chatwoot server.",
+ "version": "1.1.0",
+ "termsOfService": "https://www.chatwoot.com/terms-of-service/",
+ "contact": {
+ "email": "hello@chatwoot.com"
+ },
+ "license": {
+ "name": "MIT License",
+ "url": "https://opensource.org/licenses/MIT"
+ }
+ },
+ "servers": [
+ {
+ "url": "https://app.chatwoot.com/"
+ }
+ ],
+ "paths": {
+ "/platform/api/v1/accounts": {
+ "post": {
+ "tags": [
+ "Accounts"
+ ],
+ "operationId": "create-an-account",
+ "summary": "Create an Account",
+ "description": "Create an Account",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/accounts/{account_id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Accounts"
+ ],
+ "operationId": "get-details-of-an-account",
+ "summary": "Get an account details",
+ "description": "Get the details of an account",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Accounts"
+ ],
+ "operationId": "update-an-account",
+ "summary": "Update an account",
+ "description": "Update an account's attributes",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_account"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Accounts"
+ ],
+ "operationId": "delete-an-account",
+ "summary": "Delete an Account",
+ "description": "Delete an Account",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/accounts/{account_id}/account_users": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Account Users"
+ ],
+ "operationId": "list-all-account-users",
+ "summary": "List all Account Users",
+ "description": "List all account users",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "Account Users"
+ ],
+ "operationId": "create-an-account-user",
+ "summary": "Create an Account User",
+ "description": "Create an Account User",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/account_user_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Account Users"
+ ],
+ "operationId": "delete-an-account-user",
+ "summary": "Delete an Account User",
+ "description": "Delete an Account User",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The account does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/agent_bots": {
+ "get": {
+ "tags": [
+ "AgentBots"
+ ],
+ "operationId": "list-all-agent-bots",
+ "summary": "List all AgentBots",
+ "description": "List all agent bots available",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "array",
+ "description": "Array of agent bots",
+ "items": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "post": {
+ "tags": [
+ "AgentBots"
+ ],
+ "operationId": "create-an-agent-bot",
+ "summary": "Create an Agent Bot",
+ "description": "Create an agent bot",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/agent_bots/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/agent_bot_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "AgentBots"
+ ],
+ "operationId": "get-details-of-a-single-agent-bot",
+ "summary": "Get an agent bot details",
+ "description": "Get the details of an agent bot",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given agent bot ID does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "AgentBots"
+ ],
+ "operationId": "update-an-agent-bot",
+ "summary": "Update an agent bot",
+ "description": "Update an agent bot's attributes",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/platform_agent_bot_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/agent_bot"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "AgentBots"
+ ],
+ "operationId": "delete-an-agent-bot",
+ "summary": "Delete an AgentBot",
+ "description": "Delete an AgentBot",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The agent bot does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/users": {
+ "post": {
+ "tags": [
+ "Users"
+ ],
+ "operationId": "create-a-user",
+ "summary": "Create a User",
+ "description": "Create a User",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/users/{id}": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/platform_user_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Users"
+ ],
+ "operationId": "get-details-of-a-user",
+ "summary": "Get an user details",
+ "description": "Get the details of an user",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "patch": {
+ "tags": [
+ "Users"
+ ],
+ "operationId": "update-a-user",
+ "summary": "Update a user",
+ "description": "Update a user's attributes",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user_create_update_payload"
+ }
+ }
+ }
+ },
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/user"
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ },
+ "delete": {
+ "tags": [
+ "Users"
+ ],
+ "operationId": "delete-a-user",
+ "summary": "Delete a User",
+ "description": "Delete a User",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success"
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "/platform/api/v1/users/{id}/login": {
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/platform_user_id"
+ }
+ ],
+ "get": {
+ "tags": [
+ "Users"
+ ],
+ "operationId": "get-sso-url-of-a-user",
+ "summary": "Get User SSO Link",
+ "description": "Get the sso link of a user",
+ "security": [
+ {
+ "platformAppApiKey": []
+ }
+ ],
+ "responses": {
+ "200": {
+ "description": "Success",
+ "content": {
+ "application/json": {
+ "schema": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "SSO url to autenticate the user"
+ }
+ }
+ }
+ }
+ }
+ },
+ "401": {
+ "description": "Unauthorized",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ },
+ "404": {
+ "description": "The given user does not exist",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "components": {
+ "schemas": {
+ "bad_request_error": {
+ "title": "data",
+ "type": "object",
+ "properties": {
+ "description": {
+ "type": "string"
+ },
+ "errors": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/request_error"
+ }
+ }
+ }
+ },
+ "request_error": {
+ "type": "object",
+ "properties": {
+ "field": {
+ "type": "string"
+ },
+ "message": {
+ "type": "string"
+ },
+ "code": {
+ "type": "string"
+ }
+ }
+ },
+ "generic_id": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ }
+ }
+ },
+ "canned_response": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the canned response"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response"
+ },
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the canned response was updated"
+ }
+ }
+ },
+ "custom_attribute": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Identifier"
+ },
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name"
+ },
+ "attribute_display_type": {
+ "type": "string",
+ "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)"
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value"
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue"
+ },
+ "attribute_values": {
+ "type": "string",
+ "description": "Attribute values"
+ },
+ "attribute_model": {
+ "type": "string",
+ "description": "Attribute type(conversation_attribute/contact_attribute)"
+ },
+ "default_value": {
+ "type": "string",
+ "description": "Attribute default value"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "The date and time when the custom attribute was updated"
+ }
+ }
+ },
+ "automation_rule": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "description": "Response payload that contains automation rule(s)",
+ "oneOf": [
+ {
+ "type": "array",
+ "description": "Array of automation rules (for listing endpoint)",
+ "items": {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ },
+ {
+ "type": "object",
+ "description": "Single automation rule (for show/create/update endpoints)",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/automation_rule_item"
+ }
+ ]
+ }
+ ]
+ }
+ }
+ },
+ "automation_rule_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the automation rule"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the rule",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "Description to give more context about the rule",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created"
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation/message filter would work",
+ "items": {
+ "type": "object",
+ "properties": {
+ "values": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "attribute_key": {
+ "type": "string"
+ },
+ "query_operator": {
+ "type": "string"
+ },
+ "filter_operator": {
+ "type": "string"
+ }
+ },
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "values": [
+ "help"
+ ],
+ "query_operator": "and"
+ }
+ }
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which we perform when condition matches",
+ "items": {
+ "type": "object",
+ "properties": {
+ "action_name": {
+ "type": "string"
+ },
+ "action_params": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ },
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support",
+ "sales"
+ ]
+ }
+ }
+ },
+ "created_on": {
+ "type": "integer",
+ "description": "The timestamp when the rule was created"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ }
+ }
+ },
+ "portal": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ }
+ },
+ "portal_single": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/portal_item"
+ }
+ }
+ },
+ "portal_config": {
+ "type": "object",
+ "description": "Configuration settings for the portal",
+ "properties": {
+ "allowed_locales": {
+ "type": "array",
+ "description": "List of allowed locales for the portal",
+ "items": {
+ "type": "object",
+ "properties": {
+ "code": {
+ "type": "string",
+ "description": "The language code"
+ },
+ "articles_count": {
+ "type": "integer",
+ "description": "Number of articles in this locale"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories in this locale"
+ }
+ }
+ }
+ }
+ }
+ },
+ "portal_logo": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the logo file"
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "ID of the portal this logo belongs to"
+ },
+ "file_type": {
+ "type": "string",
+ "description": "MIME type of the file"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "file_url": {
+ "type": "string",
+ "description": "URL to access the logo file"
+ },
+ "blob_id": {
+ "type": "integer",
+ "description": "ID of the blob"
+ },
+ "filename": {
+ "type": "string",
+ "description": "Name of the file"
+ }
+ }
+ },
+ "portal_meta": {
+ "type": "object",
+ "properties": {
+ "all_articles_count": {
+ "type": "integer",
+ "description": "Total number of articles"
+ },
+ "archived_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of archived articles"
+ },
+ "published_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of published articles"
+ },
+ "draft_articles_count": {
+ "type": "integer",
+ "nullable": true,
+ "description": "Number of draft articles"
+ },
+ "categories_count": {
+ "type": "integer",
+ "description": "Number of categories"
+ },
+ "default_locale": {
+ "type": "string",
+ "description": "Default locale for the portal"
+ }
+ }
+ },
+ "portal_item": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "The ID of the portal"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Whether the portal is archived"
+ },
+ "color": {
+ "type": "string",
+ "description": "The color code for the portal"
+ },
+ "config": {
+ "$ref": "#/components/schemas/portal_config"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain for the portal"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "The header text for the portal"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "Homepage link for the portal"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the portal"
+ },
+ "slug": {
+ "type": "string",
+ "description": "URL slug for the portal"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ },
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
+ }
+ }
+ },
+ "category": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "description": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "locale": {
+ "type": "string"
+ },
+ "name": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category."
+ }
+ }
+ },
+ "article": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content."
+ },
+ "meta": {
+ "type": "object"
+ },
+ "position": {
+ "type": "integer"
+ },
+ "status": {
+ "type": "integer",
+ "enum": [
+ "draft",
+ "published",
+ "archived"
+ ]
+ },
+ "title": {
+ "type": "string"
+ },
+ "slug": {
+ "type": "string"
+ },
+ "views": {
+ "type": "integer"
+ },
+ "portal_id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "author_id": {
+ "type": "integer"
+ },
+ "category_id": {
+ "type": "integer"
+ },
+ "folder_id": {
+ "type": "integer"
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference."
+ }
+ }
+ },
+ "contact": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact",
+ "example": {
+ "attribute_key": "attribute_value",
+ "signed_up_at": "dd/mm/yyyy"
+ }
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "The last activity at of the contact"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The created at of the contact"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inboxes"
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ }
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account Id"
+ },
+ "uuid": {
+ "type": "string",
+ "description": "UUID of the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the conversation"
+ },
+ "agent_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the agent"
+ },
+ "assignee_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the assignee"
+ },
+ "can_reply": {
+ "type": "boolean",
+ "description": "Whether the conversation can be replied to"
+ },
+ "contact_last_seen_at": {
+ "type": "number",
+ "description": "The last activity at of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "The labels of the conversation"
+ },
+ "muted": {
+ "type": "boolean",
+ "description": "Whether the conversation is muted"
+ },
+ "snoozed_until": {
+ "type": "number",
+ "description": "The time at which the conversation will be unmuted"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "The status of the conversation"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The time at which conversation was created"
+ },
+ "updated_at": {
+ "type": "number",
+ "description": "The time at which conversation was updated"
+ },
+ "timestamp": {
+ "type": "string",
+ "description": "The time at which conversation was created"
+ },
+ "first_reply_created_at": {
+ "type": "number",
+ "description": "The time at which the first reply was created"
+ },
+ "unread_count": {
+ "type": "number",
+ "description": "The number of unread messages"
+ },
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the conversation"
+ },
+ "priority": {
+ "type": "string",
+ "description": "The priority of the conversation"
+ },
+ "waiting_since": {
+ "type": "number",
+ "description": "The time at which the conversation was waiting"
+ },
+ "sla_policy_id": {
+ "type": "number",
+ "description": "The ID of the SLA policy"
+ },
+ "applied_sla": {
+ "type": "object",
+ "description": "The applied SLA"
+ },
+ "sla_events": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "description": "SLA event objects"
+ }
+ }
+ }
+ },
+ "message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2
+ ],
+ "description": "The type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The time at which message was created"
+ },
+ "updated_at": {
+ "type": "integer",
+ "description": "The time at which message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flags which shows whether the message is private or not"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form"
+ ],
+ "description": "The type of the template message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type"
+ },
+ "sender_type": {
+ "type": "string",
+ "enum": [
+ "contact",
+ "agent",
+ "agent_bot"
+ ],
+ "description": "The type of the sender"
+ },
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "The external source IDs of the message"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "The processed message content"
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "The sentiment of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "The conversation object"
+ },
+ "attachment": {
+ "type": "object",
+ "description": "The file object attached to the image"
+ },
+ "sender": {
+ "type": "object",
+ "description": "User/Agent/AgentBot object"
+ }
+ }
+ },
+ "user": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "access_token": {
+ "type": "string"
+ },
+ "account_id": {
+ "type": "number"
+ },
+ "available_name": {
+ "type": "string"
+ },
+ "avatar_url": {
+ "type": "string"
+ },
+ "confirmed": {
+ "type": "boolean"
+ },
+ "display_name": {
+ "type": "string",
+ "nullable": true
+ },
+ "message_signature": {
+ "type": "string",
+ "nullable": true
+ },
+ "email": {
+ "type": "string"
+ },
+ "hmac_identifier": {
+ "type": "string"
+ },
+ "inviter_id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "provider": {
+ "type": "string"
+ },
+ "pubsub_token": {
+ "type": "string"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ]
+ },
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Available for users who are created through platform APIs and has custom attributes associated."
+ },
+ "accounts": {
+ "type": "array",
+ "items": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "status": {
+ "type": "string"
+ },
+ "active_at": {
+ "type": "string",
+ "format": "date-time"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ]
+ },
+ "permissions": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "availability": {
+ "type": "string"
+ },
+ "availability_status": {
+ "type": "string"
+ },
+ "auto_offline": {
+ "type": "boolean"
+ },
+ "custom_role_id": {
+ "type": "number",
+ "nullable": true
+ },
+ "custom_role": {
+ "type": "object",
+ "nullable": true
+ }
+ }
+ }
+ }
+ }
+ },
+ "agent": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer"
+ },
+ "account_id": {
+ "type": "integer"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent computed by Chatwoot."
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away."
+ },
+ "confirmed": {
+ "type": "boolean",
+ "description": "Whether the agent has confirmed their email address."
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the agent"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "The available name of the agent"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "The role of the agent"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent"
+ },
+ "custom_role_id": {
+ "type": "integer",
+ "description": "The custom role id of the agent"
+ }
+ }
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "Website URL"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "Widget Color used for customization of the widget"
+ },
+ "website_token": {
+ "type": "string",
+ "description": "Website Token"
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "The flag which shows whether Auto Assignment is enabled or not"
+ },
+ "web_widget_script": {
+ "type": "string",
+ "description": "Script used to load the website widget"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether greeting is enabled"
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "A greeting message when the user starts the conversation"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "ID of the channel this inbox belongs to"
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "The flag which shows whether working hours feature is enabled"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "The flag to enable collecting email from contacts"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "The flag to enable CSAT survey"
+ },
+ "auto_assignment_config": {
+ "type": "object",
+ "description": "Configuration settings for auto assignment"
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Message to show when agents are out of office"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "Configuration for working hours of the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "number",
+ "description": "Day of the week (0-6, where 0 is Sunday)"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is closed for the entire day"
+ },
+ "open_hour": {
+ "type": "number",
+ "description": "Hour when inbox opens (0-23)"
+ },
+ "open_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox opens (0-59)"
+ },
+ "close_hour": {
+ "type": "number",
+ "description": "Hour when inbox closes (0-23)"
+ },
+ "close_minutes": {
+ "type": "number",
+ "description": "Minutes of the hour when inbox closes (0-59)"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether the inbox is open for the entire day"
+ }
+ }
+ }
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone configuration for the inbox"
+ },
+ "callback_webhook_url": {
+ "type": "string",
+ "description": "Webhook URL for callbacks"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Whether to allow messages after a conversation is resolved"
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Whether to lock a contact to a single conversation"
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Type of sender name to display (e.g., friendly)"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name associated with the inbox"
+ },
+ "hmac_mandatory": {
+ "type": "boolean",
+ "description": "Whether HMAC verification is mandatory"
+ },
+ "selected_feature_flags": {
+ "type": "object",
+ "description": "Selected feature flags for the inbox"
+ },
+ "reply_time": {
+ "type": "string",
+ "description": "Expected reply time"
+ },
+ "messaging_service_sid": {
+ "type": "string",
+ "description": "Messaging service SID for SMS providers"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number associated with the inbox"
+ },
+ "medium": {
+ "type": "string",
+ "description": "Medium of communication (e.g., sms, email)"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the channel"
+ }
+ }
+ },
+ "inbox_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The avatar image of the inbox"
+ },
+ "channel_id": {
+ "type": "number",
+ "description": "The ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "The type of the inbox"
+ },
+ "provider": {
+ "type": "string",
+ "description": "The provider of the inbox"
+ }
+ }
+ },
+ "agent_bot": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "ID of the agent bot"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the agent bot"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot"
+ },
+ "bot_type": {
+ "type": "string",
+ "description": "The type of the bot"
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration of the bot"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "Account ID if it's an account specific bot"
+ },
+ "access_token": {
+ "type": "string",
+ "description": "The access token for the bot"
+ },
+ "system_bot": {
+ "type": "boolean",
+ "description": "Whether the bot is a system bot"
+ }
+ }
+ },
+ "contact_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox_contact"
+ }
+ }
+ },
+ "contactable_inboxes": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Contact Inbox Source Id"
+ },
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
+ },
+ "custom_filter": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the custom filter"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter"
+ },
+ "created_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "format": "date-time",
+ "description": "The time at which the custom filter was updated"
+ }
+ }
+ },
+ "webhook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the webhook"
+ },
+ "url": {
+ "type": "string",
+ "description": "The url to which the events will be send"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "contact_created",
+ "contact_updated",
+ "message_created",
+ "message_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The list of subscribed events"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The id of the account which the webhook object belongs to"
+ }
+ }
+ },
+ "account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "administrator",
+ "agent"
+ ],
+ "description": "The user role in the account"
+ }
+ }
+ },
+ "account_user": {
+ "type": "array",
+ "description": "Array of account users",
+ "items": {
+ "type": "object",
+ "properties": {
+ "account_id": {
+ "type": "integer",
+ "description": "The ID of the account"
+ },
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user"
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent"
+ }
+ }
+ }
+ },
+ "platform_account": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Account ID"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the account"
+ }
+ }
+ },
+ "team": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the team"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team"
+ },
+ "account_id": {
+ "type": "number",
+ "description": "The ID of the account with the team is a part of"
+ },
+ "is_member": {
+ "type": "boolean",
+ "description": "This field shows whether the current user is a part of the team"
+ }
+ }
+ },
+ "integrations_app": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the integration"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the team"
+ },
+ "hook_type": {
+ "type": "string",
+ "description": "Whether the integration is an account or inbox integration"
+ },
+ "enabled": {
+ "type": "boolean",
+ "description": "Whether the integration is enabled for the account"
+ },
+ "allow_multiple_hooks": {
+ "type": "boolean",
+ "description": "Whether multiple hooks can be created for the integration"
+ },
+ "hooks": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "If there are any hooks created for this integration"
+ }
+ }
+ },
+ "integrations_hook": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "The ID of the integration hook"
+ },
+ "app_id": {
+ "type": "string",
+ "description": "The ID of the integration app"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "Inbox ID if its an Inbox integration"
+ },
+ "account_id": {
+ "type": "string",
+ "description": "Account ID of the integration"
+ },
+ "status": {
+ "type": "boolean",
+ "description": "Whether the integration hook is enabled for the account"
+ },
+ "hook_type": {
+ "type": "boolean",
+ "description": "Whether its an account or inbox integration hook"
+ },
+ "settings": {
+ "type": "object",
+ "description": "The associated settings for the integration"
+ }
+ }
+ },
+ "public_contact": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the contact"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The session identifier of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact"
+ },
+ "pubsub_token": {
+ "type": "string",
+ "description": "The token to be used to connect to chatwoot websocket"
+ }
+ }
+ },
+ "public_conversation": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "Id of the conversation"
+ },
+ "inbox_id": {
+ "type": "string",
+ "description": "The inbox id of the conversation"
+ },
+ "messages": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message"
+ },
+ "description": "Messages in the conversation"
+ },
+ "contact": {
+ "type": "object",
+ "description": "The contact information associated to the conversation"
+ }
+ }
+ },
+ "public_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "description": "Id of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Text content of the message"
+ },
+ "message_type": {
+ "type": "string",
+ "description": "Denotes the message type"
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Content type of the message"
+ },
+ "content_attributes": {
+ "type": "string",
+ "description": "Additional content attributes of the message"
+ },
+ "created_at": {
+ "type": "string",
+ "description": "Created at time stamp of the message"
+ },
+ "conversation_id": {
+ "type": "string",
+ "description": "Conversation Id of the message"
+ },
+ "attachments": {
+ "type": "array",
+ "items": {
+ "type": "object"
+ },
+ "description": "Attachments if any"
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender"
+ }
+ }
+ },
+ "public_inbox": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "Inbox identifier"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "timezone": {
+ "type": "string",
+ "description": "The timezone defined on the inbox"
+ },
+ "working_hours": {
+ "type": "array",
+ "description": "The working hours defined on the inbox",
+ "items": {
+ "type": "object",
+ "properties": {
+ "day_of_week": {
+ "type": "integer",
+ "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6"
+ },
+ "open_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is open the whole day"
+ },
+ "closed_all_day": {
+ "type": "boolean",
+ "description": "Whether or not the business is closed the whole day"
+ },
+ "open_hour": {
+ "type": "integer",
+ "description": "Opening hour. Can be null if closed all day"
+ },
+ "open_minutes": {
+ "type": "integer",
+ "description": "Opening minute. Can be null if closed all day"
+ },
+ "close_hour": {
+ "type": "integer",
+ "description": "Closing hour. Can be null if closed all day"
+ },
+ "close_minutes": {
+ "type": "integer",
+ "description": "Closing minute. Can be null if closed all day"
+ }
+ }
+ }
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the working hours are enabled on the inbox"
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the Greeting Message is enabled on the inbox"
+ },
+ "identity_validation_enabled": {
+ "type": "boolean",
+ "description": "Whether of not the User Identity Validation is enforced on the inbox"
+ }
+ }
+ },
+ "account_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the account",
+ "example": "My Account"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the account",
+ "example": "en"
+ },
+ "domain": {
+ "type": "string",
+ "description": "The domain of the account",
+ "example": "example.com"
+ },
+ "support_email": {
+ "type": "string",
+ "description": "The support email of the account",
+ "example": "support@example.com"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "active",
+ "suspended"
+ ],
+ "description": "The status of the account",
+ "example": "active"
+ },
+ "limits": {
+ "type": "object",
+ "description": "The limits of the account",
+ "example": {}
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the account",
+ "example": {}
+ }
+ }
+ },
+ "account_user_create_update_payload": {
+ "type": "object",
+ "required": [
+ "user_id",
+ "role"
+ ],
+ "properties": {
+ "user_id": {
+ "type": "integer",
+ "description": "The ID of the user",
+ "example": 1
+ },
+ "role": {
+ "type": "string",
+ "description": "whether user is an administrator or agent",
+ "example": "administrator"
+ }
+ }
+ },
+ "platform_agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "The account ID to associate the agent bot with",
+ "example": 1
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ }
+ }
+ },
+ "agent_bot_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the agent bot",
+ "example": "My Agent Bot"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the agent bot",
+ "example": "This is a sample agent bot"
+ },
+ "outgoing_url": {
+ "type": "string",
+ "description": "The webhook URL for the bot",
+ "example": "https://example.com/webhook"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the agent bot avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "bot_type": {
+ "type": "integer",
+ "description": "The type of the bot (0 for webhook)",
+ "example": 0
+ },
+ "bot_config": {
+ "type": "object",
+ "description": "The configuration for the bot",
+ "example": {}
+ }
+ }
+ },
+ "user_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the user",
+ "example": "Daniel"
+ },
+ "display_name": {
+ "type": "string",
+ "description": "Display name of the user",
+ "example": "Dan"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the user",
+ "example": "daniel@acme.inc"
+ },
+ "password": {
+ "type": "string",
+ "description": "Password must contain uppercase, lowercase letters, number and a special character",
+ "example": "Password2!"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes you want to associate with the user",
+ "example": {}
+ }
+ }
+ },
+ "canned_response_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Message content for canned response",
+ "example": "Hello, {{contact.name}}! Welcome to our service."
+ },
+ "short_code": {
+ "type": "string",
+ "description": "Short Code for quick access of the canned response",
+ "example": "welcome"
+ }
+ }
+ },
+ "custom_attribute_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "attribute_display_name": {
+ "type": "string",
+ "description": "Attribute display name",
+ "example": "Custom Attribute"
+ },
+ "attribute_display_type": {
+ "type": "integer",
+ "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)",
+ "example": 0
+ },
+ "attribute_description": {
+ "type": "string",
+ "description": "Attribute description",
+ "example": "This is a custom attribute"
+ },
+ "attribute_key": {
+ "type": "string",
+ "description": "Attribute unique key value",
+ "example": "custom_attribute"
+ },
+ "attribute_values": {
+ "type": "array",
+ "description": "Attribute values",
+ "items": {
+ "type": "string"
+ },
+ "example": [
+ "value1",
+ "value2"
+ ]
+ },
+ "attribute_model": {
+ "type": "integer",
+ "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)",
+ "example": 0
+ },
+ "regex_pattern": {
+ "type": "string",
+ "description": "Regex pattern (Only applicable for type- text). The regex pattern is used to validate the attribute value(s).",
+ "example": "^[a-zA-Z0-9]+$"
+ },
+ "regex_cue": {
+ "type": "string",
+ "description": "Regex cue message (Only applicable for type- text). The cue message is shown when the regex pattern is not matched.",
+ "example": "Please enter a valid value"
+ }
+ }
+ },
+ "agent_create_payload": {
+ "type": "object",
+ "required": [
+ "name",
+ "email",
+ "role"
+ ],
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Full Name of the agent",
+ "example": "John Doe"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the Agent",
+ "example": "john.doe@acme.inc"
+ },
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability setting of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "agent_update_payload": {
+ "type": "object",
+ "required": [
+ "role"
+ ],
+ "properties": {
+ "role": {
+ "type": "string",
+ "enum": [
+ "agent",
+ "administrator"
+ ],
+ "description": "Whether its administrator or agent",
+ "example": "agent"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "available",
+ "busy",
+ "offline"
+ ],
+ "description": "The availability status of the agent.",
+ "example": "available"
+ },
+ "auto_offline": {
+ "type": "boolean",
+ "description": "Whether the availability status of agent is configured to go offline automatically when away.",
+ "example": true
+ }
+ }
+ },
+ "contact_create_payload": {
+ "type": "object",
+ "required": [
+ "inbox_id"
+ ],
+ "properties": {
+ "inbox_id": {
+ "type": "number",
+ "description": "ID of the inbox to which the contact belongs",
+ "example": 1
+ },
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "contact_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "name of the contact",
+ "example": "Alice"
+ },
+ "email": {
+ "type": "string",
+ "description": "email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "whether the contact is blocked or not",
+ "example": false
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "The url to a jpeg, png file for the contact avatar",
+ "example": "https://example.com/avatar.png"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "A unique identifier for the contact in external system",
+ "example": "1234567890"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "An object where you can store additional attributes for contact. example {\"type\":\"customer\", \"age\":30}",
+ "example": {
+ "type": "customer",
+ "age": 30
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}, this should have a valid custom attribute definition.",
+ "example": {}
+ }
+ }
+ },
+ "conversation_create_payload": {
+ "type": "object",
+ "required": [
+ "source_id",
+ "inbox_id"
+ ],
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Conversation source id",
+ "example": "1234567890"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email",
+ "example": 1
+ },
+ "contact_id": {
+ "type": "integer",
+ "description": "Contact Id for which conversation is created",
+ "example": 1
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Lets you specify attributes like browser information",
+ "example": {
+ "browser": "Chrome",
+ "browser_version": "89.0.4389.82",
+ "os": "Windows",
+ "os_version": "10"
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The object to save custom attributes for conversation, accepts custom attributes key and value",
+ "example": {
+ "attribute_key": "attribute_value",
+ "priority_conversation_number": 3
+ }
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved",
+ "pending"
+ ],
+ "description": "Specify the conversation whether it's pending, open, closed",
+ "example": "open"
+ },
+ "assignee_id": {
+ "type": "integer",
+ "description": "Agent Id for assigning a conversation to an agent",
+ "example": 1
+ },
+ "team_id": {
+ "type": "integer",
+ "description": "Team Id for assigning a conversation to a team\\",
+ "example": 1
+ },
+ "snoozed_until": {
+ "type": "string",
+ "format": "date-time",
+ "description": "Snoozed until date time",
+ "example": "2030-07-21T17:32:28Z"
+ },
+ "message": {
+ "type": "object",
+ "description": "The initial message to be sent to the conversation",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_message_create_payload": {
+ "type": "object",
+ "required": [
+ "content"
+ ],
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "The content of the message",
+ "example": "Hello, how can I help you?"
+ },
+ "message_type": {
+ "type": "string",
+ "enum": [
+ "outgoing",
+ "incoming"
+ ],
+ "description": "The type of the message",
+ "example": "outgoing"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Flag to identify if it is a private note",
+ "example": false
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_email",
+ "cards",
+ "input_select",
+ "form",
+ "article"
+ ],
+ "description": "Content type of the message",
+ "example": "text"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes based on the content type",
+ "example": {}
+ },
+ "campaign_id": {
+ "type": "integer",
+ "description": "The campaign id to which the message belongs",
+ "example": 1
+ },
+ "template_params": {
+ "type": "object",
+ "description": "The template params for the message in case of whatsapp Channel",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Name of the template",
+ "example": "sample_issue_resolution"
+ },
+ "category": {
+ "type": "string",
+ "description": "Category of the template",
+ "example": "UTILITY"
+ },
+ "language": {
+ "type": "string",
+ "description": "Language of the template",
+ "example": "en_US"
+ },
+ "processed_params": {
+ "type": "object",
+ "description": "The processed param values for template variables in template",
+ "example": {
+ "1": "Chatwoot"
+ }
+ }
+ }
+ }
+ }
+ },
+ "inbox_create_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "type": {
+ "type": "string",
+ "description": "Type of the channel",
+ "enum": [
+ "web_widget",
+ "api",
+ "email",
+ "line",
+ "telegram",
+ "whatsapp",
+ "sms"
+ ],
+ "example": "web_widget"
+ },
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "inbox_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the inbox",
+ "example": "Support"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Image file for avatar"
+ },
+ "greeting_enabled": {
+ "type": "boolean",
+ "description": "Enable greeting message",
+ "example": true
+ },
+ "greeting_message": {
+ "type": "string",
+ "description": "Greeting message to be displayed on the widget",
+ "example": "Hello, how can I help you?"
+ },
+ "enable_email_collect": {
+ "type": "boolean",
+ "description": "Enable email collection",
+ "example": true
+ },
+ "csat_survey_enabled": {
+ "type": "boolean",
+ "description": "Enable CSAT survey",
+ "example": true
+ },
+ "enable_auto_assignment": {
+ "type": "boolean",
+ "description": "Enable Auto Assignment",
+ "example": true
+ },
+ "working_hours_enabled": {
+ "type": "boolean",
+ "description": "Enable working hours",
+ "example": true
+ },
+ "out_of_office_message": {
+ "type": "string",
+ "description": "Out of office message to be displayed on the widget",
+ "example": "We are currently out of office. Please leave a message and we will get back to you."
+ },
+ "timezone": {
+ "type": "string",
+ "description": "Timezone of the inbox",
+ "example": "America/New_York"
+ },
+ "allow_messages_after_resolved": {
+ "type": "boolean",
+ "description": "Allow messages after conversation is resolved",
+ "example": true
+ },
+ "lock_to_single_conversation": {
+ "type": "boolean",
+ "description": "Lock to single conversation",
+ "example": true
+ },
+ "portal_id": {
+ "type": "integer",
+ "description": "Id of the help center portal to attach to the inbox",
+ "example": 1
+ },
+ "sender_name_type": {
+ "type": "string",
+ "description": "Sender name type for the inbox",
+ "enum": [
+ "friendly",
+ "professional"
+ ],
+ "example": "friendly"
+ },
+ "business_name": {
+ "type": "string",
+ "description": "Business name for the inbox",
+ "example": "My Business"
+ },
+ "channel": {
+ "type": "object",
+ "properties": {
+ "website_url": {
+ "type": "string",
+ "description": "URL at which the widget will be loaded",
+ "example": "https://example.com"
+ },
+ "welcome_title": {
+ "type": "string",
+ "description": "Welcome title to be displayed on the widget",
+ "example": "Welcome to our support"
+ },
+ "welcome_tagline": {
+ "type": "string",
+ "description": "Welcome tagline to be displayed on the widget",
+ "example": "We are here to help you"
+ },
+ "widget_color": {
+ "type": "string",
+ "description": "A Hex-color string used to customize the widget",
+ "example": "#FF5733"
+ }
+ }
+ }
+ }
+ },
+ "team_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the team",
+ "example": "Support Team"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the team",
+ "example": "This is a team of support agents"
+ },
+ "allow_auto_assign": {
+ "type": "boolean",
+ "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team",
+ "example": true
+ }
+ }
+ },
+ "custom_filter_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the custom filter",
+ "example": "My Custom Filter"
+ },
+ "type": {
+ "type": "string",
+ "enum": [
+ "conversation",
+ "contact",
+ "report"
+ ],
+ "description": "The description about the custom filter",
+ "example": "conversation"
+ },
+ "query": {
+ "type": "object",
+ "description": "A query that needs to be saved as a custom filter",
+ "example": {}
+ }
+ }
+ },
+ "webhook_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "url": {
+ "type": "string",
+ "description": "The url where the events should be sent",
+ "example": "https://example.com/webhook"
+ },
+ "subscriptions": {
+ "type": "array",
+ "items": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_status_changed",
+ "conversation_updated",
+ "message_created",
+ "message_updated",
+ "contact_created",
+ "contact_updated",
+ "webwidget_triggered"
+ ]
+ },
+ "description": "The events you want to subscribe to.",
+ "example": [
+ "conversation_created",
+ "conversation_status_changed"
+ ]
+ }
+ }
+ },
+ "integrations_hook_create_payload": {
+ "type": "object",
+ "properties": {
+ "app_id": {
+ "type": "integer",
+ "description": "The ID of app for which integration hook is being created",
+ "example": 1
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "The inbox ID, if the hook is an inbox hook",
+ "example": 1
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "integrations_hook_update_payload": {
+ "type": "object",
+ "properties": {
+ "status": {
+ "type": "integer",
+ "description": "The status of the integration (0 for inactive, 1 for active)",
+ "example": 1
+ },
+ "settings": {
+ "type": "object",
+ "description": "The settings required by the integration",
+ "example": {}
+ }
+ }
+ },
+ "automation_rule_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "Rule name",
+ "example": "Add label on message create event"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description about the automation and actions",
+ "example": "Add label support and sales on message create event if incoming message content contains text help"
+ },
+ "event_name": {
+ "type": "string",
+ "enum": [
+ "conversation_created",
+ "conversation_updated",
+ "message_created"
+ ],
+ "example": "message_created",
+ "description": "The event when you want to execute the automation actions"
+ },
+ "active": {
+ "type": "boolean",
+ "description": "Enable/disable automation rule"
+ },
+ "actions": {
+ "type": "array",
+ "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "action_name": "add_label",
+ "action_params": [
+ "support"
+ ]
+ }
+ }
+ },
+ "conditions": {
+ "type": "array",
+ "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.",
+ "items": {
+ "type": "object",
+ "example": {
+ "attribute_key": "content",
+ "filter_operator": "contains",
+ "query_operator": "OR",
+ "values": [
+ "help"
+ ]
+ }
+ }
+ }
+ }
+ },
+ "portal_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "color": {
+ "type": "string",
+ "description": "Header color for help-center in hex format",
+ "example": "#FFFFFF"
+ },
+ "custom_domain": {
+ "type": "string",
+ "description": "Custom domain to display help center.",
+ "example": "chatwoot.help"
+ },
+ "header_text": {
+ "type": "string",
+ "description": "Help center header",
+ "example": "Handbook"
+ },
+ "homepage_link": {
+ "type": "string",
+ "description": "link to main dashboard",
+ "example": "https://www.chatwoot.com/"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name for the portal",
+ "example": "Handbook"
+ },
+ "page_title": {
+ "type": "string",
+ "description": "Page title for the portal",
+ "example": "Handbook"
+ },
+ "slug": {
+ "type": "string",
+ "description": "Slug for the portal to display in link",
+ "example": "handbook"
+ },
+ "archived": {
+ "type": "boolean",
+ "description": "Status to check if portal is live",
+ "example": false
+ },
+ "config": {
+ "type": "object",
+ "description": "Configuration about supporting locales",
+ "example": {
+ "allowed_locales": [
+ "en",
+ "es"
+ ],
+ "default_locale": "en"
+ }
+ }
+ }
+ },
+ "category_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the category",
+ "example": "Category Name"
+ },
+ "description": {
+ "type": "string",
+ "description": "A description for the category",
+ "example": "Category description"
+ },
+ "position": {
+ "type": "integer",
+ "description": "Category position in the portal list to sort",
+ "example": 1
+ },
+ "slug": {
+ "type": "string",
+ "description": "The category slug used in the URL",
+ "example": "category-name"
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the category",
+ "example": "en"
+ },
+ "icon": {
+ "type": "string",
+ "description": "The icon of the category as a string (emoji)",
+ "example": "📚"
+ },
+ "parent_category_id": {
+ "type": "integer",
+ "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category.",
+ "example": 1
+ },
+ "associated_category_id": {
+ "type": "integer",
+ "description": "To associate similar categories to each other, e.g same category of product documentation in different languages",
+ "example": 2
+ }
+ }
+ },
+ "article_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "title": {
+ "type": "string",
+ "description": "The title of the article",
+ "example": "Article Title"
+ },
+ "slug": {
+ "type": "string",
+ "description": "The slug of the article",
+ "example": "article-title"
+ },
+ "position": {
+ "type": "integer",
+ "description": "article position in category",
+ "example": 1
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content.",
+ "example": "This is the content of the article"
+ },
+ "description": {
+ "type": "string",
+ "description": "The description of the article",
+ "example": "This is the description of the article"
+ },
+ "category_id": {
+ "type": "integer",
+ "description": "The category id of the article",
+ "example": 1
+ },
+ "author_id": {
+ "type": "integer",
+ "description": "The author agent id of the article",
+ "example": 1
+ },
+ "associated_article_id": {
+ "type": "integer",
+ "description": "To associate similar articles to each other, e.g to provide the link for the reference.",
+ "example": 2
+ },
+ "status": {
+ "type": "integer",
+ "description": "The status of the article. 0 for draft, 1 for published, 2 for archived",
+ "example": 1
+ },
+ "locale": {
+ "type": "string",
+ "description": "The locale of the article",
+ "example": "en"
+ },
+ "meta": {
+ "type": "object",
+ "description": "Use for search",
+ "example": {
+ "tags": [
+ "article_name"
+ ],
+ "title": "article title",
+ "description": "article description"
+ }
+ }
+ }
+ },
+ "public_contact_create_update_payload": {
+ "type": "object",
+ "properties": {
+ "identifier": {
+ "type": "string",
+ "description": "External identifier of the contact",
+ "example": "1234567890"
+ },
+ "identifier_hash": {
+ "type": "string",
+ "description": "Identifier hash prepared for HMAC authentication",
+ "example": "e93275d4eba0e5679ad55f5360af00444e2a888df9b0afa3e8b691c3173725f9"
+ },
+ "email": {
+ "type": "string",
+ "description": "Email of the contact",
+ "example": "alice@acme.inc"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the contact",
+ "example": "Alice"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "Phone number of the contact",
+ "example": "+123456789"
+ },
+ "avatar": {
+ "type": "string",
+ "format": "binary",
+ "description": "Send the form data with the avatar image binary or use the avatar_url"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the customer",
+ "example": {}
+ }
+ }
+ },
+ "public_message_create_payload": {
+ "type": "object",
+ "properties": {
+ "content": {
+ "type": "string",
+ "description": "Content for the message",
+ "example": "Hello, how can I help you?"
+ },
+ "echo_id": {
+ "type": "string",
+ "description": "Temporary identifier which will be passed back via websockets",
+ "example": "1234567890"
+ }
+ }
+ },
+ "public_message_update_payload": {
+ "type": "object",
+ "properties": {
+ "submitted_values": {
+ "type": "object",
+ "description": "Replies to the Bot Message Types",
+ "properties": {
+ "name": {
+ "type": "string",
+ "description": "The name of the submiitted value",
+ "example": "My Name"
+ },
+ "title": {
+ "type": "string",
+ "description": "The title of the submitted value",
+ "example": "My Title"
+ },
+ "value": {
+ "type": "string",
+ "description": "The value of the submitted value",
+ "example": "value"
+ },
+ "csat_survey_response": {
+ "type": "object",
+ "description": "The CSAT survey response",
+ "properties": {
+ "feedback_message": {
+ "type": "string",
+ "description": "The feedback message of the CSAT survey response",
+ "example": "Great service!"
+ },
+ "rating": {
+ "type": "integer",
+ "description": "The rating of the CSAT survey response",
+ "example": 5
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "public_conversation_create_payload": {
+ "type": "object",
+ "properties": {
+ "custom_attributes": {
+ "type": "object",
+ "description": "Custom attributes of the conversation",
+ "example": {}
+ }
+ }
+ },
+ "extended_contact": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "Id of the user"
+ },
+ "availability_status": {
+ "type": "string",
+ "enum": [
+ "online",
+ "offline"
+ ],
+ "description": "Availability status of the user"
+ }
+ }
+ }
+ ]
+ },
+ "contact_base": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ },
+ "contact_list": {
+ "type": "array",
+ "description": "array of contacts",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/contact"
+ }
+ ]
+ }
+ },
+ "contact_conversations": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ },
+ {
+ "type": "object",
+ "properties": {
+ "display_id": {
+ "type": "number"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "contact_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "conversation_list": {
+ "type": "object",
+ "properties": {
+ "data": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "mine_count": {
+ "type": "number"
+ },
+ "unassigned_count": {
+ "type": "number"
+ },
+ "assigned_count": {
+ "type": "number"
+ },
+ "all_count": {
+ "type": "number"
+ }
+ }
+ },
+ "payload": {
+ "type": "array",
+ "description": "array of conversations",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/generic_id"
+ },
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ }
+ }
+ }
+ }
+ }
+ },
+ "conversation_show": {
+ "type": "object",
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "conversation_status_toggle": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object"
+ },
+ "payload": {
+ "type": "object",
+ "properties": {
+ "success": {
+ "type": "boolean"
+ },
+ "current_status": {
+ "type": "string",
+ "enum": [
+ "open",
+ "resolved"
+ ]
+ },
+ "conversation_id": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "conversation_labels": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of labels",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "account_summary": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ },
+ "previous": {
+ "type": "object",
+ "properties": {
+ "avg_first_response_time": {
+ "type": "string"
+ },
+ "avg_resolution_time": {
+ "type": "string"
+ },
+ "conversations_count": {
+ "type": "number"
+ },
+ "incoming_messages_count": {
+ "type": "number"
+ },
+ "outgoing_messages_count": {
+ "type": "number"
+ },
+ "resolutions_count": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "agent_conversation_metrics": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number"
+ },
+ "name": {
+ "type": "string"
+ },
+ "email": {
+ "type": "string"
+ },
+ "thumbnail": {
+ "type": "string"
+ },
+ "availability": {
+ "type": "string"
+ },
+ "metric": {
+ "type": "object",
+ "properties": {
+ "open": {
+ "type": "number"
+ },
+ "unattended": {
+ "type": "number"
+ }
+ }
+ }
+ }
+ },
+ "contact_detail": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact"
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "type": {
+ "type": "string",
+ "description": "The type of entity",
+ "enum": [
+ "contact"
+ ]
+ }
+ }
+ },
+ "message_detailed": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "number",
+ "description": "The ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "The text content of the message"
+ },
+ "inbox_id": {
+ "type": "number",
+ "description": "The ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "number",
+ "description": "The ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "enum": [
+ 0,
+ 1,
+ 2,
+ 3
+ ],
+ "description": "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)"
+ },
+ "content_type": {
+ "type": "string",
+ "enum": [
+ "text",
+ "input_select",
+ "cards",
+ "form",
+ "input_csat"
+ ],
+ "description": "The type of the message content"
+ },
+ "status": {
+ "type": "string",
+ "enum": [
+ "sent",
+ "delivered",
+ "read",
+ "failed"
+ ],
+ "description": "The status of the message"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "The content attributes for each content_type",
+ "properties": {
+ "in_reply_to": {
+ "type": "string",
+ "description": "ID of the message this is replying to",
+ "nullable": true
+ }
+ }
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "The timestamp when message was created"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "The flag which shows whether the message is private or not"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "The source ID of the message",
+ "nullable": true
+ },
+ "sender": {
+ "$ref": "#/components/schemas/contact_detail"
+ }
+ }
+ },
+ "conversation_meta": {
+ "type": "object",
+ "properties": {
+ "labels": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ },
+ "description": "Labels associated with the conversation"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "properties": {
+ "browser": {
+ "type": "object",
+ "properties": {
+ "device_name": {
+ "type": "string",
+ "description": "Name of the device"
+ },
+ "browser_name": {
+ "type": "string",
+ "description": "Name of the browser"
+ },
+ "platform_name": {
+ "type": "string",
+ "description": "Name of the platform"
+ },
+ "browser_version": {
+ "type": "string",
+ "description": "Version of the browser"
+ },
+ "platform_version": {
+ "type": "string",
+ "description": "Version of the platform"
+ }
+ }
+ },
+ "referer": {
+ "type": "string",
+ "description": "Referrer URL"
+ },
+ "initiated_at": {
+ "type": "object",
+ "properties": {
+ "timestamp": {
+ "type": "string",
+ "description": "Timestamp when the conversation was initiated"
+ }
+ }
+ },
+ "browser_language": {
+ "type": "string",
+ "description": "Browser language setting"
+ },
+ "conversation_language": {
+ "type": "string",
+ "description": "Conversation language"
+ }
+ },
+ "description": "Additional attributes of the conversation"
+ },
+ "contact": {
+ "$ref": "#/components/schemas/contact_detail"
+ },
+ "agent_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the agent last saw the conversation",
+ "nullable": true
+ },
+ "assignee_last_seen_at": {
+ "type": "string",
+ "description": "Timestamp when the assignee last saw the conversation",
+ "nullable": true
+ }
+ }
+ },
+ "conversation_messages": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/conversation_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/message_detailed"
+ },
+ "description": "List of messages in the conversation"
+ }
+ }
+ },
+ "contact_meta": {
+ "type": "object",
+ "properties": {
+ "count": {
+ "type": "integer",
+ "description": "Total number of contacts"
+ },
+ "current_page": {
+ "type": "string",
+ "description": "Current page number"
+ }
+ }
+ },
+ "contact_inbox": {
+ "type": "object",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source identifier for the contact inbox"
+ },
+ "inbox": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL for the inbox avatar"
+ },
+ "channel_id": {
+ "type": "integer",
+ "description": "ID of the channel"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the inbox"
+ },
+ "channel_type": {
+ "type": "string",
+ "description": "Type of channel"
+ },
+ "provider": {
+ "type": "string",
+ "description": "Provider of the inbox",
+ "nullable": true
+ }
+ }
+ }
+ }
+ },
+ "contact_list_item": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The object containing additional attributes related to the contact",
+ "properties": {
+ "city": {
+ "type": "string",
+ "description": "City of the contact"
+ },
+ "country": {
+ "type": "string",
+ "description": "Country of the contact"
+ },
+ "country_code": {
+ "type": "string",
+ "description": "Country code of the contact"
+ },
+ "created_at_ip": {
+ "type": "string",
+ "description": "IP address when the contact was created"
+ }
+ }
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the contact",
+ "enum": [
+ "online",
+ "offline"
+ ]
+ },
+ "email": {
+ "type": "string",
+ "description": "The email address of the contact",
+ "nullable": true
+ },
+ "id": {
+ "type": "integer",
+ "description": "The ID of the contact"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the contact"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the contact",
+ "nullable": true
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the contact is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the contact",
+ "nullable": true
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "The thumbnail of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the contact"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity",
+ "nullable": true
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when contact was created"
+ },
+ "contact_inboxes": {
+ "type": "array",
+ "description": "List of inboxes associated with this contact",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ }
+ }
+ }
+ },
+ "contacts_list_response": {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "$ref": "#/components/schemas/contact_meta"
+ },
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_list_item"
+ },
+ "description": "List of contacts"
+ }
+ }
+ },
+ "contact_show_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "$ref": "#/components/schemas/contact_list_item"
+ }
+ }
+ },
+ "contact_conversation_message": {
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the message"
+ },
+ "content": {
+ "type": "string",
+ "description": "Content of the message"
+ },
+ "account_id": {
+ "type": "integer",
+ "description": "ID of the account"
+ },
+ "inbox_id": {
+ "type": "integer",
+ "description": "ID of the inbox"
+ },
+ "conversation_id": {
+ "type": "integer",
+ "description": "ID of the conversation"
+ },
+ "message_type": {
+ "type": "integer",
+ "description": "Type of the message"
+ },
+ "created_at": {
+ "type": "integer",
+ "description": "Timestamp when message was created"
+ },
+ "updated_at": {
+ "type": "string",
+ "description": "Formatted datetime when message was updated"
+ },
+ "private": {
+ "type": "boolean",
+ "description": "Whether the message is private"
+ },
+ "status": {
+ "type": "string",
+ "description": "Status of the message"
+ },
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the message",
+ "nullable": true
+ },
+ "content_type": {
+ "type": "string",
+ "description": "Type of the content"
+ },
+ "content_attributes": {
+ "type": "object",
+ "description": "Attributes of the content"
+ },
+ "sender_type": {
+ "type": "string",
+ "description": "Type of the sender",
+ "nullable": true
+ },
+ "sender_id": {
+ "type": "integer",
+ "description": "ID of the sender",
+ "nullable": true
+ },
+ "external_source_ids": {
+ "type": "object",
+ "description": "External source IDs"
+ },
+ "additional_attributes": {
+ "type": "object",
+ "description": "Additional attributes of the message"
+ },
+ "processed_message_content": {
+ "type": "string",
+ "description": "Processed message content",
+ "nullable": true
+ },
+ "sentiment": {
+ "type": "object",
+ "description": "Sentiment analysis of the message"
+ },
+ "conversation": {
+ "type": "object",
+ "description": "Conversation details",
+ "properties": {
+ "assignee_id": {
+ "type": "integer",
+ "description": "ID of the assignee",
+ "nullable": true
+ },
+ "unread_count": {
+ "type": "integer",
+ "description": "Count of unread messages"
+ },
+ "last_activity_at": {
+ "type": "integer",
+ "description": "Timestamp of last activity"
+ },
+ "contact_inbox": {
+ "type": "object",
+ "description": "Contact inbox details",
+ "properties": {
+ "source_id": {
+ "type": "string",
+ "description": "Source ID of the contact inbox"
+ }
+ }
+ }
+ }
+ },
+ "sender": {
+ "type": "object",
+ "description": "Details of the sender",
+ "properties": {
+ "id": {
+ "type": "integer",
+ "description": "ID of the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "Name of the sender"
+ },
+ "available_name": {
+ "type": "string",
+ "description": "Available name of the sender"
+ },
+ "avatar_url": {
+ "type": "string",
+ "description": "URL of the sender's avatar"
+ },
+ "type": {
+ "type": "string",
+ "description": "Type of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "Availability status of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Thumbnail URL of the sender"
+ }
+ }
+ }
+ }
+ },
+ "contact_conversations_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "allOf": [
+ {
+ "$ref": "#/components/schemas/conversation"
+ },
+ {
+ "type": "object",
+ "properties": {
+ "meta": {
+ "type": "object",
+ "properties": {
+ "sender": {
+ "type": "object",
+ "properties": {
+ "additional_attributes": {
+ "type": "object",
+ "description": "The additional attributes of the sender"
+ },
+ "availability_status": {
+ "type": "string",
+ "description": "The availability status of the sender"
+ },
+ "email": {
+ "type": "string",
+ "description": "The email of the sender"
+ },
+ "id": {
+ "type": "number",
+ "description": "ID fo the sender"
+ },
+ "name": {
+ "type": "string",
+ "description": "The name of the sender"
+ },
+ "phone_number": {
+ "type": "string",
+ "description": "The phone number of the sender"
+ },
+ "blocked": {
+ "type": "boolean",
+ "description": "Whether the sender is blocked"
+ },
+ "identifier": {
+ "type": "string",
+ "description": "The identifier of the sender"
+ },
+ "thumbnail": {
+ "type": "string",
+ "description": "Avatar URL of the contact"
+ },
+ "custom_attributes": {
+ "type": "object",
+ "description": "The custom attributes of the sender"
+ },
+ "last_activity_at": {
+ "type": "number",
+ "description": "The last activity at of the sender"
+ },
+ "created_at": {
+ "type": "number",
+ "description": "The created at of the sender"
+ }
+ }
+ },
+ "channel": {
+ "type": "string",
+ "description": "Channel Type"
+ },
+ "assignee": {
+ "$ref": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
+ }
+ }
+ }
+ }
+ }
+ ]
+ },
+ "description": "List of conversations for the contact"
+ }
+ }
+ },
+ "contactable_inboxes_response": {
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/contact_inbox"
+ },
+ "description": "List of contactable inboxes for the contact"
+ }
+ }
+ }
+ },
+ "parameters": {
+ "account_id": {
+ "in": "path",
+ "name": "account_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the account"
+ },
+ "agent_bot_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the agentbot to be updated"
+ },
+ "team_id": {
+ "in": "path",
+ "name": "team_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the team to be updated"
+ },
+ "inbox_id": {
+ "in": "path",
+ "name": "inbox_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The ID of the Inbox"
+ },
+ "hook_id": {
+ "in": "path",
+ "name": "hook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the integration hook"
+ },
+ "source_id": {
+ "in": "path",
+ "name": "source_id",
+ "required": true,
+ "schema": {
+ "type": "string"
+ },
+ "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.
Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String"
+ },
+ "contact_sort_param": {
+ "in": "query",
+ "name": "sort",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "name",
+ "email",
+ "phone_number",
+ "last_activity_at",
+ "-name",
+ "-email",
+ "-phone_number",
+ "-last_activity_at"
+ ]
+ },
+ "required": false,
+ "description": "The attribute by which list should be sorted"
+ },
+ "conversation_id": {
+ "in": "path",
+ "name": "conversation_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the conversation"
+ },
+ "conversation_uuid": {
+ "in": "path",
+ "name": "conversation_uuid",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The uuid of the conversation"
+ },
+ "custom_filter_id": {
+ "in": "path",
+ "name": "custom_filter_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the custom filter"
+ },
+ "webhook_id": {
+ "in": "path",
+ "name": "webhook_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the webhook"
+ },
+ "message_id": {
+ "in": "path",
+ "name": "message_id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the message"
+ },
+ "page": {
+ "in": "query",
+ "name": "page",
+ "schema": {
+ "type": "integer",
+ "default": 1
+ },
+ "required": false,
+ "description": "The page parameter"
+ },
+ "platform_user_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "integer"
+ },
+ "required": true,
+ "description": "The numeric ID of the user on the platform"
+ },
+ "report_type": {
+ "in": "query",
+ "name": "type",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "account",
+ "agent",
+ "inbox",
+ "label",
+ "team"
+ ]
+ },
+ "required": true,
+ "description": "Type of report"
+ },
+ "report_metric": {
+ "in": "query",
+ "name": "metric",
+ "schema": {
+ "type": "string",
+ "enum": [
+ "conversations_count",
+ "incoming_messages_count",
+ "outgoing_messages_count",
+ "avg_first_response_time",
+ "avg_resolution_time",
+ "resolutions_count"
+ ]
+ },
+ "required": true,
+ "description": "The type of metric"
+ },
+ "public_inbox_identifier": {
+ "in": "path",
+ "name": "inbox_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The identifier obtained from API inbox channel"
+ },
+ "public_contact_identifier": {
+ "in": "path",
+ "name": "contact_identifier",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The source id of contact obtained on contact create"
+ },
+ "portal_id": {
+ "in": "path",
+ "name": "id",
+ "schema": {
+ "type": "string"
+ },
+ "required": true,
+ "description": "The slug identifier of the portal"
+ }
+ },
+ "securitySchemes": {
+ "userApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user."
+ },
+ "agentBotApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis."
+ },
+ "platformAppApiKey": {
+ "type": "apiKey",
+ "in": "header",
+ "name": "api_access_token",
+ "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles."
+ }
+ }
+ },
+ "tags": [
+ {
+ "name": "Accounts",
+ "description": "Account management APIs"
+ },
+ {
+ "name": "Account Users",
+ "description": "Account user management APIs"
+ },
+ {
+ "name": "AgentBots",
+ "description": "Bot integrations"
+ },
+ {
+ "name": "Users",
+ "description": "User management APIs"
+ }
+ ],
+ "x-tagGroups": [
+ {
+ "name": "Platform",
+ "tags": [
+ "Accounts",
+ "Account Users",
+ "AgentBots",
+ "Users"
+ ]
+ },
+ {
+ "name": "Application",
+ "tags": [
+ "Account AgentBots",
+ "Agents",
+ "Canned Responses",
+ "Contacts",
+ "Contact Labels",
+ "Conversation Assignments",
+ "Conversation Labels",
+ "Conversations",
+ "Custom Attributes",
+ "Custom Filters",
+ "Inboxes",
+ "Integrations",
+ "Messages",
+ "Profile",
+ "Reports",
+ "Teams",
+ "Webhooks",
+ "Automation Rule",
+ "Help Center"
+ ]
+ },
+ {
+ "name": "Client",
+ "tags": [
+ "Contacts API",
+ "Conversations API",
+ "Messages API"
+ ]
+ },
+ {
+ "name": "Others",
+ "tags": [
+ "CSAT Survey Page"
+ ]
+ }
+ ]
+}
\ No newline at end of file