diff --git a/Gemfile b/Gemfile
index 6f6bd7751..b4752c745 100644
--- a/Gemfile
+++ b/Gemfile
@@ -33,6 +33,8 @@ gem 'liquid'
gem 'commonmarker'
# Validate Data against JSON Schema
gem 'json_schemer'
+# used in swagger build
+gem 'json_refs'
# Rack middleware for blocking & throttling abusive requests
gem 'rack-attack', '>= 6.7.0'
# a utility tool for streaming, flexible and safe downloading of remote files
@@ -196,9 +198,6 @@ group :development do
gem 'scss_lint', require: false
gem 'web-console', '>= 4.2.1'
- # used in swagger build
- gem 'json_refs'
-
# When we want to squash migrations
gem 'squasher'
diff --git a/developer-docs/README.md b/developer-docs/README.md
new file mode 100644
index 000000000..d9426cd19
--- /dev/null
+++ b/developer-docs/README.md
@@ -0,0 +1,28 @@
+## Chatwoot Developer Documentation
+
+Welcome to the official Chatwoot developer documentation. This guide contains everything you need to know about Chatwoot APIs and build custom flows on top of Chatwoot APIs.
+
+### 👩💻 Development
+
+Install the [Mintlify CLI](https://www.npmjs.com/package/mintlify) to preview the documentation changes locally. To install, use the following command
+
+```
+npm i -g mintlify
+```
+
+Run the following command at the root of your documentation (where mint.json is)
+
+```
+mintlify dev
+```
+
+### 😎 Publishing Changes
+
+Changes will be deployed to production automatically after pushing to the default branch.
+
+You can also preview changes using PRs, which generates a preview link of the docs.
+
+#### Troubleshooting
+
+- Mintlify dev isn't running - Run `mintlify install` it'll re-install dependencies.
+- Page loads as a 404 - Make sure you are running in a folder with `mint.json`
diff --git a/developer-docs/docs.json b/developer-docs/docs.json
new file mode 100644
index 000000000..7507fbb28
--- /dev/null
+++ b/developer-docs/docs.json
@@ -0,0 +1,84 @@
+{
+ "name": "Chatwoot Developer Docs",
+ "description": "Official developer documentation for Chatwoot - the open-source customer support platform. Learn about our APIs, integrations, and development guidelines.",
+ "logo": {
+ "dark": "/logo/dark.png",
+ "light": "/logo/light.png"
+ },
+ "favicon": "/favicon.png",
+ "colors": {
+ "primary": "#0069ED",
+ "light": "#4D9CFF",
+ "dark": "#0050B4"
+ },
+ "theme": "maple",
+ "navigation": {
+ "tabs": [
+ {
+ "tab": "API Documentation",
+ "groups": [
+ {
+ "group": "Platform API",
+ "description": "APIs for managing platform aspects of Chatwoot",
+ "includeTags": [
+ "Accounts",
+ "Account Users",
+ "AgentBots",
+ "Users"
+ ],
+ "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/platform_swagger.json"
+ },
+ {
+ "group": "Application API",
+ "description": "APIs for managing application aspects of Chatwoot",
+ "includeTags": [
+ "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"
+ ],
+ "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/application_swagger.json"
+ },
+ {
+ "group": "Client API",
+ "description": "APIs for client applications",
+ "includeTags": [
+ "Contacts API",
+ "Conversations API",
+ "Messages API"
+ ],
+ "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/client_swagger.json"
+ },
+ {
+ "group": "Other APIs",
+ "description": "Other Chatwoot APIs",
+ "includeTags": [
+ "CSAT Survey Page"
+ ],
+ "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/develop/swagger/tag_groups/other_swagger.json"
+ }
+ ]
+ }
+ ]
+ },
+ "footerSocials": {
+ "twitter": "https://twitter.com/chatwootapp",
+ "github": "https://github.com/chatwoot",
+ "linkedin": "https://www.linkedin.com/company/chatwoot"
+ }
+}
\ No newline at end of file
diff --git a/developer-docs/favicon.png b/developer-docs/favicon.png
new file mode 100644
index 000000000..4b7824e37
Binary files /dev/null and b/developer-docs/favicon.png differ
diff --git a/developer-docs/logo/dark.png b/developer-docs/logo/dark.png
new file mode 100644
index 000000000..9af20120e
Binary files /dev/null and b/developer-docs/logo/dark.png differ
diff --git a/developer-docs/logo/light.png b/developer-docs/logo/light.png
new file mode 100644
index 000000000..86d75cf5f
Binary files /dev/null and b/developer-docs/logo/light.png differ
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/swagger/definitions/index.yml b/swagger/definitions/index.yml
index 8514a3957..57e10e2dd 100644
--- a/swagger/definitions/index.yml
+++ b/swagger/definitions/index.yml
@@ -16,8 +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
+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:
@@ -34,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:
@@ -173,7 +187,6 @@ contact_list:
description: 'array of contacts'
items:
allOf:
- - $ref: '#/components/schemas/generic_id'
- $ref: '#/components/schemas/contact'
contact_conversations:
type: array
@@ -201,3 +214,28 @@ 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/resource/agent.yml b/swagger/definitions/resource/agent.yml
index dd1379b50..5287f3e6f 100644
--- a/swagger/definitions/resource/agent.yml
+++ b/swagger/definitions/resource/agent.yml
@@ -2,23 +2,8 @@ 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']
@@ -26,6 +11,25 @@ properties:
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 57d5f98af..259604f0d 100644
--- a/swagger/definitions/resource/contact.yml
+++ b/swagger/definitions/resource/contact.yml
@@ -1,32 +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: '#/components/schemas/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 7ccba61b1..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: '#/components/schemas/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_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 0a16f0134..c1577e693 100644
--- a/swagger/definitions/resource/conversation.yml
+++ b/swagger/definitions/resource/conversation.yml
@@ -10,27 +10,82 @@ properties:
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 19936e7e8..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: '#/components/schemas/user'
+ hmac_verified:
+ type: boolean
+ description: Whether the hmac is verified
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 5fb13e9b8..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: '#/components/schemas/category'
- articles:
- type: array
- items:
- $ref: '#/components/schemas/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/user.yml b/swagger/definitions/resource/user.yml
index b788713ad..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
+ 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: '#/components/schemas/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 f0a97f0a6..e27425d41 100644
--- a/swagger/index.yml
+++ b/swagger/index.yml
@@ -34,7 +34,61 @@ components:
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:
@@ -48,6 +102,9 @@ x-tagGroups:
- Agents
- Canned Responses
- Contacts
+ - Contact Labels
+ - Conversation Assignments
+ - Conversation Labels
- Conversations
- Custom Attributes
- Custom Filters
diff --git a/swagger/paths/application/automation_rule/index.yml b/swagger/paths/application/automation_rule/index.yml
index e1b78fa37..b5193e1af 100644
--- a/swagger/paths/application/automation_rule/index.yml
+++ b/swagger/paths/application/automation_rule/index.yml
@@ -14,10 +14,7 @@ responses:
content:
application/json:
schema:
- type: array
- description: Array of all automation rules
- items:
- $ref: '#/components/schemas/automation_rule'
+ $ref: '#/components/schemas/automation_rule'
'403':
description: Access denied
content:
diff --git a/swagger/paths/application/automation_rule/show.yml b/swagger/paths/application/automation_rule/show.yml
index cd53ef478..ea3db048b 100644
--- a/swagger/paths/application/automation_rule/show.yml
+++ b/swagger/paths/application/automation_rule/show.yml
@@ -19,6 +19,26 @@ responses:
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:
diff --git a/swagger/paths/application/contactable_inboxes/get.yml b/swagger/paths/application/contactable_inboxes/get.yml
index 3f56f6939..357c84597 100644
--- a/swagger/paths/application/contactable_inboxes/get.yml
+++ b/swagger/paths/application/contactable_inboxes/get.yml
@@ -20,7 +20,7 @@ get:
content:
application/json:
schema:
- $ref: '#/components/schemas/contactable_inboxes'
+ $ref: '#/components/schemas/contactable_inboxes_response'
'401':
description: Authentication error
content:
diff --git a/swagger/paths/application/contacts/conversations.yml b/swagger/paths/application/contacts/conversations.yml
index e6c586298..b1bd7e522 100644
--- a/swagger/paths/application/contacts/conversations.yml
+++ b/swagger/paths/application/contacts/conversations.yml
@@ -28,7 +28,7 @@ get:
content:
application/json:
schema:
- $ref: '#/components/schemas/contact_conversations'
+ $ref: '#/components/schemas/contact_conversations_response'
'404':
description: Contact not found
content:
diff --git a/swagger/paths/application/contacts/crud.yml b/swagger/paths/application/contacts/crud.yml
index 9f76e4ba4..dcabb145d 100644
--- a/swagger/paths/application/contacts/crud.yml
+++ b/swagger/paths/application/contacts/crud.yml
@@ -21,7 +21,7 @@ get:
content:
application/json:
schema:
- $ref: '#/components/schemas/extended_contact'
+ $ref: '#/components/schemas/contact_show_response'
'404':
description: Contact not found
content:
diff --git a/swagger/paths/application/contacts/filter.yml b/swagger/paths/application/contacts/filter.yml
index 58b297d81..10d49f8c6 100644
--- a/swagger/paths/application/contacts/filter.yml
+++ b/swagger/paths/application/contacts/filter.yml
@@ -55,7 +55,7 @@ post:
content:
application/json:
schema:
- $ref: '#/components/schemas/contact_list'
+ $ref: '#/components/schemas/contacts_list_response'
'400':
description: Bad Request Error
content:
diff --git a/swagger/paths/application/contacts/labels.yml b/swagger/paths/application/contacts/labels.yml
index 61be4a545..a764e36b2 100644
--- a/swagger/paths/application/contacts/labels.yml
+++ b/swagger/paths/application/contacts/labels.yml
@@ -9,7 +9,7 @@ parameters:
get:
tags:
- - Contacts
+ - Contact Labels
operationId: list-all-labels-of-a-contact
summary: List Labels
description: Lists all the labels of a contact
@@ -37,7 +37,7 @@ get:
post:
tags:
- - Contacts
+ - 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.
diff --git a/swagger/paths/application/contacts/list_create.yml b/swagger/paths/application/contacts/list_create.yml
index 505fd8200..eb5754a15 100644
--- a/swagger/paths/application/contacts/list_create.yml
+++ b/swagger/paths/application/contacts/list_create.yml
@@ -16,7 +16,7 @@ get:
content:
application/json:
schema:
- $ref: '#/components/schemas/contact_list'
+ $ref: '#/components/schemas/contacts_list_response'
'400':
description: Bad Request Error
content:
diff --git a/swagger/paths/application/contacts/search.yml b/swagger/paths/application/contacts/search.yml
index c44406e6c..61075dc00 100644
--- a/swagger/paths/application/contacts/search.yml
+++ b/swagger/paths/application/contacts/search.yml
@@ -21,10 +21,7 @@ get:
content:
application/json:
schema:
- type: object
- properties:
- payload:
- $ref: '#/components/schemas/contact_list'
+ $ref: '#/components/schemas/contacts_list_response'
'401':
description: Authentication error
content:
diff --git a/swagger/paths/application/conversation/assignments.yml b/swagger/paths/application/conversation/assignments.yml
index 50fdacbf0..49b7022db 100644
--- a/swagger/paths/application/conversation/assignments.yml
+++ b/swagger/paths/application/conversation/assignments.yml
@@ -1,5 +1,5 @@
tags:
- - Conversations
+ - Conversation Assignments
operationId: assign-a-conversation
summary: Assign Conversation
description: Assign a conversation to an agent or a team
diff --git a/swagger/paths/application/conversation/messages/index.yml b/swagger/paths/application/conversation/messages/index.yml
index fc6882b33..02693a244 100644
--- a/swagger/paths/application/conversation/messages/index.yml
+++ b/swagger/paths/application/conversation/messages/index.yml
@@ -11,12 +11,32 @@ responses:
content:
application/json:
schema:
- type: array
- description: Array of messages
- items:
- allOf:
- - $ref: '#/components/schemas/generic_id'
- - $ref: '#/components/schemas/message'
+ 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:
diff --git a/swagger/paths/application/inboxes/inbox_members/create.yml b/swagger/paths/application/inboxes/inbox_members/create.yml
index 1f1396bd3..47dcb8b2e 100644
--- a/swagger/paths/application/inboxes/inbox_members/create.yml
+++ b/swagger/paths/application/inboxes/inbox_members/create.yml
@@ -31,10 +31,13 @@ responses:
content:
application/json:
schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/components/schemas/agent'
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
'404':
description: Inbox not found
content:
diff --git a/swagger/paths/application/inboxes/inbox_members/show.yml b/swagger/paths/application/inboxes/inbox_members/show.yml
index 65ec9f969..ec10a5f0b 100644
--- a/swagger/paths/application/inboxes/inbox_members/show.yml
+++ b/swagger/paths/application/inboxes/inbox_members/show.yml
@@ -13,10 +13,13 @@ responses:
content:
application/json:
schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/components/schemas/agent'
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
'404':
description: Inbox not found
content:
diff --git a/swagger/paths/application/inboxes/inbox_members/update.yml b/swagger/paths/application/inboxes/inbox_members/update.yml
index 18fc3f2c8..728c2a028 100644
--- a/swagger/paths/application/inboxes/inbox_members/update.yml
+++ b/swagger/paths/application/inboxes/inbox_members/update.yml
@@ -31,10 +31,13 @@ responses:
content:
application/json:
schema:
- type: array
- description: 'Array of all active agents'
- items:
- $ref: '#/components/schemas/agent'
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of all active agents'
+ items:
+ $ref: '#/components/schemas/agent'
'404':
description: Inbox not found
content:
diff --git a/swagger/paths/application/inboxes/index.yml b/swagger/paths/application/inboxes/index.yml
index 7856319ec..89abb6009 100644
--- a/swagger/paths/application/inboxes/index.yml
+++ b/swagger/paths/application/inboxes/index.yml
@@ -14,10 +14,13 @@ get:
content:
application/json:
schema:
- type: array
- description: 'Array of inboxes'
- items:
- $ref: '#/components/schemas/inbox'
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of inboxes'
+ items:
+ $ref: '#/components/schemas/inbox'
'404':
description: Inbox not found
content:
diff --git a/swagger/paths/application/integrations/apps/show.yml b/swagger/paths/application/integrations/apps/show.yml
index 96fab5b1b..ab5403bd6 100644
--- a/swagger/paths/application/integrations/apps/show.yml
+++ b/swagger/paths/application/integrations/apps/show.yml
@@ -11,10 +11,13 @@ responses:
content:
application/json:
schema:
- type: array
- description: 'Array of Integration apps'
- items:
- $ref: '#/components/schemas/integrations_app'
+ type: object
+ properties:
+ payload:
+ type: array
+ description: 'Array of Integration apps'
+ items:
+ $ref: '#/components/schemas/integrations_app'
'401':
description: Unauthorized
content:
diff --git a/swagger/paths/application/portal/index.yml b/swagger/paths/application/portal/index.yml
index 5cafe09e5..1c57fc7fb 100644
--- a/swagger/paths/application/portal/index.yml
+++ b/swagger/paths/application/portal/index.yml
@@ -13,10 +13,45 @@ responses:
content:
application/json:
schema:
- type: array
- description: Array of all portals
- items:
- $ref: '#/components/schemas/portal'
+ $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:
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 5faa170cc..0679a37d0 100644
--- a/swagger/paths/application/portal/update.yml
+++ b/swagger/paths/application/portal/update.yml
@@ -5,6 +5,9 @@ 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:
@@ -17,10 +20,66 @@ responses:
content:
application/json:
schema:
- $ref: '#/components/schemas/portal'
+ $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/index.yml b/swagger/paths/index.yml
index 59d7c06b8..379b2eef0 100644
--- a/swagger/paths/index.yml
+++ b/swagger/paths/index.yml
@@ -63,11 +63,6 @@
- $ref: '#/components/parameters/platform_user_id'
get:
$ref: './platform/users/login.yml'
-/platform/api/v1/users/{id}/token:
- parameters:
- - $ref: '#/parameters/platform_user_id'
- post:
- $ref: './platform/users/token.yml'
# ---------------- end of platform path -----------#
@@ -605,3 +600,27 @@
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/swagger.json b/swagger/swagger.json
index 8ce34b4ab..943b7a3e8 100644
--- a/swagger/swagger.json
+++ b/swagger/swagger.json
@@ -801,78 +801,6 @@
}
}
},
- "/platform/api/v1/users/{id}/token": {
- "parameters": [
- {
- "$ref": "#/parameters/platform_user_id"
- }
- ],
- "post": {
- "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"
- }
- }
- }
- },
"/public/api/v1/inboxes/{inbox_identifier}": {
"parameters": [
{
@@ -2532,7 +2460,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/contact_list"
+ "$ref": "#/components/schemas/contacts_list_response"
}
}
}
@@ -2633,7 +2561,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/extended_contact"
+ "$ref": "#/components/schemas/contact_show_response"
}
}
}
@@ -2798,7 +2726,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/contact_conversations"
+ "$ref": "#/components/schemas/contact_conversations_response"
}
}
}
@@ -2843,7 +2771,7 @@
],
"get": {
"tags": [
- "Contacts"
+ "Contact Labels"
],
"operationId": "list-all-labels-of-a-contact",
"summary": "List Labels",
@@ -2888,7 +2816,7 @@
},
"post": {
"tags": [
- "Contacts"
+ "Contact Labels"
],
"operationId": "contact-add-labels",
"summary": "Add Labels",
@@ -2996,12 +2924,7 @@
"content": {
"application/json": {
"schema": {
- "type": "object",
- "properties": {
- "payload": {
- "$ref": "#/components/schemas/contact_list"
- }
- }
+ "$ref": "#/components/schemas/contacts_list_response"
}
}
}
@@ -3117,7 +3040,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/contact_list"
+ "$ref": "#/components/schemas/contacts_list_response"
}
}
}
@@ -3253,7 +3176,7 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/contactable_inboxes"
+ "$ref": "#/components/schemas/contactable_inboxes_response"
}
}
}
@@ -3313,11 +3236,7 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of all automation rules",
- "items": {
- "$ref": "#/components/schemas/automation_rule"
- }
+ "$ref": "#/components/schemas/automation_rule"
}
}
}
@@ -3425,6 +3344,43 @@
"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
+ }
}
}
}
@@ -3641,11 +3597,56 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of all portals",
- "items": {
- "$ref": "#/components/schemas/portal"
- }
+ "$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"
+ }
+ }
+ ]
}
}
}
@@ -3684,6 +3685,14 @@
"userApiKey": []
}
],
+ "parameters": [
+ {
+ "$ref": "#/components/parameters/account_id"
+ },
+ {
+ "$ref": "#/components/parameters/portal_id"
+ }
+ ],
"requestBody": {
"required": true,
"content": {
@@ -3700,7 +3709,66 @@
"content": {
"application/json": {
"schema": {
- "$ref": "#/components/schemas/portal"
+ "$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"
+ }
+ }
}
}
}
@@ -3714,6 +3782,16 @@
}
}
}
+ },
+ "404": {
+ "description": "Portal not found",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/bad_request_error"
+ }
+ }
+ }
}
}
}
@@ -4616,7 +4694,7 @@
],
"post": {
"tags": [
- "Conversations"
+ "Conversation Assignments"
],
"operationId": "assign-a-conversation",
"summary": "Assign Conversation",
@@ -4835,10 +4913,15 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of inboxes",
- "items": {
- "$ref": "#/components/schemas/inbox"
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of inboxes",
+ "items": {
+ "$ref": "#/components/schemas/inbox"
+ }
+ }
}
}
}
@@ -5228,10 +5311,15 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/components/schemas/agent"
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
}
}
@@ -5315,10 +5403,15 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/components/schemas/agent"
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
}
}
@@ -5405,10 +5498,15 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of all active agents",
- "items": {
- "$ref": "#/components/schemas/agent"
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of all active agents",
+ "items": {
+ "$ref": "#/components/schemas/agent"
+ }
+ }
}
}
}
@@ -5549,17 +5647,43 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of messages",
- "items": {
- "allOf": [
- {
- "$ref": "#/components/schemas/generic_id"
- },
- {
+ "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"
}
- ]
+ }
}
}
}
@@ -5728,10 +5852,15 @@
"content": {
"application/json": {
"schema": {
- "type": "array",
- "description": "Array of Integration apps",
- "items": {
- "$ref": "#/components/schemas/integrations_app"
+ "type": "object",
+ "properties": {
+ "payload": {
+ "type": "array",
+ "description": "Array of Integration apps",
+ "items": {
+ "$ref": "#/components/schemas/integrations_app"
+ }
+ }
}
}
}
@@ -7255,6 +7384,42 @@
}
}
}
+ },
+ "/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"
+ }
+ }
+ }
+ }
+ }
+ }
}
},
"components": {
@@ -7303,17 +7468,25 @@
"type": "integer",
"description": "ID of the canned response"
},
- "content": {
- "type": "string",
- "description": "Message content for canned response"
+ "account_id": {
+ "type": "integer",
+ "description": "Account Id"
},
"short_code": {
"type": "string",
"description": "Short Code for quick access of the canned response"
},
- "account_id": {
- "type": "integer",
- "description": "Account Id"
+ "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"
}
}
},
@@ -7340,36 +7513,72 @@
"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"
}
}
},
"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"
+ "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",
@@ -7381,15 +7590,64 @@
"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"
+ "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": [
@@ -7399,76 +7657,181 @@
}
}
},
- "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": {
+ "created_on": {
"type": "integer",
- "description": "Account Id"
+ "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"
+ "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"
+ "type": "boolean",
+ "description": "Whether the portal is archived"
},
"color": {
- "type": "string"
+ "type": "string",
+ "description": "The color code for the portal"
},
"config": {
- "type": "object",
- "description": "Save information about locales, allowed_locales and default portal/help-center locale"
+ "$ref": "#/components/schemas/portal_config"
},
"custom_domain": {
- "type": "string"
+ "type": "string",
+ "description": "Custom domain for the portal"
},
"header_text": {
"type": "string",
- "description": "The text content."
+ "description": "The header text for the portal"
},
"homepage_link": {
- "type": "string"
+ "type": "string",
+ "description": "Homepage link for the portal"
},
"name": {
- "type": "string"
+ "type": "string",
+ "description": "Name of the portal"
},
"slug": {
- "type": "string"
+ "type": "string",
+ "description": "URL slug for the portal"
},
"page_title": {
- "type": "string"
+ "type": "string",
+ "description": "Page title for the portal"
},
"account_id": {
- "type": "integer"
+ "type": "integer",
+ "description": "ID of the account the portal belongs to"
},
- "categories": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/category"
- }
+ "inbox": {
+ "$ref": "#/components/schemas/inbox"
},
- "articles": {
- "type": "array",
- "items": {
- "$ref": "#/components/schemas/article"
- }
+ "logo": {
+ "$ref": "#/components/schemas/portal_logo"
+ },
+ "meta": {
+ "$ref": "#/components/schemas/portal_meta"
}
}
},
@@ -7568,44 +7931,66 @@
"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": "#/components/schemas/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"
}
}
}
@@ -7630,10 +8015,53 @@
"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": [
@@ -7643,30 +8071,54 @@
],
"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": {
- "type": "object",
- "description": "The object containing additional attributes related to the conversation"
+ "last_non_activity_message": {
+ "$ref": "#/components/schemas/message"
},
- "custom_attributes": {
+ "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"
}
}
}
@@ -7674,10 +8126,61 @@
"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": [
@@ -7692,23 +8195,38 @@
"type": "object",
"description": "The content attributes for each content_type"
},
- "message_type": {
+ "sender_type": {
"type": "string",
"enum": [
- "incoming",
- "outgoing",
- "activity",
- "template"
+ "contact",
+ "agent",
+ "agent_bot"
],
- "description": "The type of the message"
+ "description": "The type of the sender"
},
- "created_at": {
- "type": "integer",
- "description": "The time at which message was created"
+ "sender_id": {
+ "type": "number",
+ "description": "The ID of the sender"
},
- "private": {
- "type": "boolean",
- "description": "The flags which shows whether the message is private or not"
+ "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",
@@ -7717,10 +8235,6 @@
"sender": {
"type": "object",
"description": "User/Agent/AgentBot object"
- },
- "conversation_id": {
- "type": "number",
- "description": "ID of the conversation"
}
}
},
@@ -7730,24 +8244,47 @@
"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": [
@@ -7755,8 +8292,15 @@
"administrator"
]
},
- "confirmed": {
- "type": "boolean"
+ "ui_settings": {
+ "type": "object"
+ },
+ "uid": {
+ "type": "string"
+ },
+ "type": {
+ "type": "string",
+ "nullable": true
},
"custom_attributes": {
"type": "object",
@@ -7765,7 +8309,52 @@
"accounts": {
"type": "array",
"items": {
- "$ref": "#/components/schemas/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
+ }
+ }
}
}
}
@@ -7776,34 +8365,9 @@
"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": [
@@ -7817,9 +8381,37 @@
"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"
}
}
},
@@ -7877,6 +8469,148 @@
"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"
}
}
},
@@ -7895,13 +8629,33 @@
"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"
}
}
},
@@ -7913,7 +8667,7 @@
"description": "Contact Inbox Source Id"
},
"inbox": {
- "$ref": "#/components/schemas/inbox"
+ "$ref": "#/components/schemas/inbox_contact"
}
}
},
@@ -9645,9 +10399,6 @@
"description": "array of contacts",
"items": {
"allOf": [
- {
- "$ref": "#/components/schemas/generic_id"
- },
{
"$ref": "#/components/schemas/contact"
}
@@ -9671,6 +10422,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"
@@ -9679,18 +10442,46 @@
"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": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
}
}
}
@@ -9762,6 +10553,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"
@@ -9770,18 +10573,46 @@
"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": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
}
}
}
@@ -9809,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"
@@ -9817,18 +10660,46 @@
"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": "#/components/schemas/user"
+ },
+ "hmac_verified": {
+ "type": "boolean",
+ "description": "Whether the hmac is verified"
}
}
}
@@ -9950,6 +10821,656 @@
}
}
}
+ },
+ "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": {
@@ -10172,6 +11693,116 @@
}
}
},
+ "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",
@@ -10189,6 +11820,9 @@
"Agents",
"Canned Responses",
"Contacts",
+ "Contact Labels",
+ "Conversation Assignments",
+ "Conversation Labels",
"Conversations",
"Custom Attributes",
"Custom Filters",
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