diff --git a/developer-docs/docs.json b/developer-docs/docs.json index 43d19ef9a..de0f70bc5 100644 --- a/developer-docs/docs.json +++ b/developer-docs/docs.json @@ -16,7 +16,60 @@ "tabs": [ { "tab": "API Documentation", - "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/90c600acd94cfe2f5c41d5cedebdec9534cba2d7/swagger/swagger.json" + "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/90c600acd94cfe2f5c41d5cedebdec9534cba2d7/swagger/tag_groups/platform_swagger.json" + }, + { + "group": "Application API", + "description": "APIs for managing application aspects of Chatwoot", + "includeTags": [ + "Account AgentBots", + "Agents", + "Canned Responses", + "Contacts", + "Conversations", + "Custom Attributes", + "Custom Filters", + "Inboxes", + "Integrations", + "Messages", + "Profile", + "Reports", + "Teams", + "Webhooks", + "Automation Rule", + "Help Center" + ], + "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/90c600acd94cfe2f5c41d5cedebdec9534cba2d7/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/90c600acd94cfe2f5c41d5cedebdec9534cba2d7/swagger/tag_groups/client_swagger.json" + }, + { + "group": "Other APIs", + "description": "Other Chatwoot APIs", + "includeTags": [ + "CSAT Survey Page" + ], + "openapi": "https://raw.githubusercontent.com/chatwoot/chatwoot/90c600acd94cfe2f5c41d5cedebdec9534cba2d7/swagger/tag_groups/other_swagger.json" + } + ] } ] }, @@ -25,4 +78,4 @@ "github": "https://github.com/chatwoot", "linkedin": "https://www.linkedin.com/company/chatwoot" } -} +} \ No newline at end of file diff --git a/lib/tasks/swagger.rake b/lib/tasks/swagger.rake index cf61e179d..54d07dd7f 100644 --- a/lib/tasks/swagger.rake +++ b/lib/tasks/swagger.rake @@ -30,48 +30,89 @@ namespace :swagger do base_path = Rails.root.join('swagger') tag_groups_path = base_path.join('tag_groups') - Dir.chdir(tag_groups_path) do - # Build for platform - platform_yaml = YAML.safe_load(File.open('platform.yml')) - platform_build = JsonRefs.call( - platform_yaml, - resolve_local_ref: false, - resolve_file_ref: true, - logging: true - ) - File.write('platform_swagger.json', JSON.pretty_generate(platform_build)) + # Load the full swagger specification + full_spec = JSON.parse(File.read(base_path.join('swagger.json'))) + + # Load the tag groups from index.yml + swagger_index = YAML.safe_load(File.open(base_path.join('index.yml'))) + tag_groups = swagger_index['x-tagGroups'] + + # Process each tag group + tag_groups.each do |tag_group| + group_name = tag_group['name'] + tags = tag_group['tags'] - # Build for application - application_yaml = YAML.safe_load(File.open('application.yml')) - application_build = JsonRefs.call( - application_yaml, - resolve_local_ref: false, - resolve_file_ref: true, - logging: true - ) - File.write('application_swagger.json', JSON.pretty_generate(application_build)) + # Create a copy of the full spec for this tag group + tag_spec = full_spec.dup - # Build for client - client_yaml = YAML.safe_load(File.open('client.yml')) - client_build = JsonRefs.call( - client_yaml, - resolve_local_ref: false, - resolve_file_ref: true, - logging: true - ) - File.write('client_swagger.json', JSON.pretty_generate(client_build)) + # Filter paths to only include those with operations tagged with any of our tags + filtered_paths = {} - # Build for others - others_yaml = YAML.safe_load(File.open('others.yml')) - others_build = JsonRefs.call( - others_yaml, - resolve_local_ref: false, - resolve_file_ref: true, - logging: true - ) - File.write('other_swagger.json', JSON.pretty_generate(others_build)) + full_spec['paths'].each do |path, path_item| + # Check if any operation in this path has a tag from our group + operations_with_our_tags = false + + path_item.each do |method, operation| + next unless operation.is_a?(Hash) && operation['tags'] + + # Check if any of our tags are in the operation's tags + if (operation['tags'] & tags).any? + operations_with_our_tags = true + break + end + end + + # If we found operations with our tags, add the path to our filtered paths + if operations_with_our_tags + filtered_paths[path] = path_item + end + end + + # Replace the paths in our tag-specific spec + tag_spec['paths'] = filtered_paths + + # Filter tags to only include those in our group + tag_spec['tags'] = full_spec['tags'].select { |tag| tags.include?(tag['name']) } + + # Write the tag-specific spec to file + output_file = "#{group_name.downcase}_swagger.json" + output_file = "other_swagger.json" if group_name.downcase == 'others' + + File.write(tag_groups_path.join(output_file), JSON.pretty_generate(tag_spec)) end puts 'Tag-specific swagger files generated successfully.' end + + desc 'build swagger files and create symlinks in developer-docs' + task build_for_docs: :environment do + # First, build the swagger files + Rake::Task['swagger:build'].invoke + + # Create directories in developer-docs if they don't exist + dev_docs_public = Rails.root.join('developer-docs', 'public') + FileUtils.mkdir_p(File.join(dev_docs_public, 'swagger', 'tag_groups')) + + # Create symlinks to the swagger files + tag_groups_path = Rails.root.join('swagger', 'tag_groups') + + # Symlink each JSON file + 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| + source = File.join(tag_groups_path, file) + target = File.join(dev_docs_public, 'swagger', 'tag_groups', file) + + # Remove existing file or symlink + FileUtils.rm_f(target) + + # Create a relative symbolic link + rel_path = Pathname.new(source).relative_path_from(Pathname.new(File.dirname(target))) + FileUtils.ln_sf(rel_path, target) + end + + puts 'Symlinks created successfully.' + puts 'You can now run the Mintlify dev server to preview the documentation.' + end end diff --git a/swagger/tag_groups/application_swagger.json b/swagger/tag_groups/application_swagger.json index b486473ba..20e34b990 100644 --- a/swagger/tag_groups/application_swagger.json +++ b/swagger/tag_groups/application_swagger.json @@ -1,8 +1,8 @@ { "openapi": "3.0.4", "info": { - "title": "Chatwoot - Application API", - "description": "Application API endpoints for Chatwoot", + "title": "Chatwoot", + "description": "This is the API documentation for Chatwoot server.", "version": "1.1.0", "termsOfService": "https://www.chatwoot.com/terms-of-service/", "contact": { @@ -18,1592 +18,7 @@ "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": "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": { - "/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" - } - } - } - } - } - } - }, - "/public/api/v1/inboxes/{inbox_identifier}": { - "parameters": [ - { - "$ref": "#/components/parameters/public_inbox_identifier" - } - ], - "get": { - "tags": [ - "Inbox API" - ], - "operationId": "get-details-of-a-inbox", - "summary": "Inbox details", - "description": "Get the details of an inbox", - "security": [ - - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/public_inbox" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "404": { - "description": "The given inbox does not exist", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, - "/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" - } - } - } - }, "/api/v1/accounts/{account_id}/agent_bots": { "parameters": [ { @@ -3242,156 +1657,6 @@ } } }, - "/api/v1/accounts/{account_id}/contacts/{id}/contact_inboxes": { - "post": { - "tags": [ - "Contact" - ], - "operationId": "contactInboxCreation", - "description": "Create a contact inbox record for an inbox", - "summary": "Create contact inbox", - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "security": [ - { - "userApiKey": [ - - ] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number", - "description": "The ID of the inbox", - "example": 1 - }, - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contact_inboxes" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes": { - "get": { - "tags": [ - "Contact" - ], - "operationId": "contactableInboxesGet", - "description": "Get List of contactable Inboxes", - "summary": "Get Contactable Inboxes", - "security": [ - { - "userApiKey": [ - - ] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contactable_inboxes_response" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, "/api/v1/accounts/{account_id}/automation_rules": { "parameters": [ { @@ -7708,42 +5973,6 @@ } } } - }, - "/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": { @@ -11972,8 +10201,132 @@ "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." + "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": "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", + "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_swagger.json b/swagger/tag_groups/client_swagger.json index 910b0d42e..d63d4c3dc 100644 --- a/swagger/tag_groups/client_swagger.json +++ b/swagger/tag_groups/client_swagger.json @@ -1,8 +1,8 @@ { "openapi": "3.0.4", "info": { - "title": "Chatwoot - Client API", - "description": "Client API endpoints for Chatwoot", + "title": "Chatwoot", + "description": "This is the API documentation for Chatwoot server.", "version": "1.1.0", "termsOfService": "https://www.chatwoot.com/terms-of-service/", "contact": { @@ -18,887 +18,7 @@ "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": { - "/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" - } - } - } - } - } - } - }, - "/public/api/v1/inboxes/{inbox_identifier}": { - "parameters": [ - { - "$ref": "#/components/parameters/public_inbox_identifier" - } - ], - "get": { - "tags": [ - "Inbox API" - ], - "operationId": "get-details-of-a-inbox", - "summary": "Inbox details", - "description": "Get the details of an inbox", - "security": [ - - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/public_inbox" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "404": { - "description": "The given inbox does not exist", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, "/public/api/v1/inboxes/{inbox_identifier}/contacts": { "parameters": [ { @@ -1528,6170 +648,6 @@ } } } - }, - "/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" - } - } - } - }, - "/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": [ - "Contacts" - ], - "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": [ - "Contacts" - ], - "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}/contacts/{id}/contact_inboxes": { - "post": { - "tags": [ - "Contact" - ], - "operationId": "contactInboxCreation", - "description": "Create a contact inbox record for an inbox", - "summary": "Create contact inbox", - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "security": [ - { - "userApiKey": [ - - ] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number", - "description": "The ID of the inbox", - "example": 1 - }, - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contact_inboxes" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes": { - "get": { - "tags": [ - "Contact" - ], - "operationId": "contactableInboxesGet", - "description": "Get List of contactable Inboxes", - "summary": "Get Contactable Inboxes", - "security": [ - { - "userApiKey": [ - - ] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contactable_inboxes_response" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "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": [ - "Conversations" - ], - "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" - } - } - } - } - } - } - }, - "/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": { @@ -11920,8 +4876,80 @@ "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." + "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 APIs for contacts" + }, + { + "name": "Conversations API", + "description": "Public APIs for conversations" + }, + { + "name": "Messages API", + "description": "Public APIs for messages" + } + ], + "x-tagGroups": [ + { + "name": "Platform", + "tags": [ + "Accounts", + "Account Users", + "AgentBots", + "Users" + ] + }, + { + "name": "Application", + "tags": [ + "Account AgentBots", + "Agents", + "Canned Responses", + "Contacts", + "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 index 6182b876e..9d78d9825 100644 --- a/swagger/tag_groups/other_swagger.json +++ b/swagger/tag_groups/other_swagger.json @@ -1,8 +1,8 @@ { "openapi": "3.0.4", "info": { - "title": "Chatwoot - Other APIs", - "description": "Other API endpoints for Chatwoot", + "title": "Chatwoot", + "description": "This is the API documentation for Chatwoot server.", "version": "1.1.0", "termsOfService": "https://www.chatwoot.com/terms-of-service/", "contact": { @@ -18,1509 +18,7 @@ "url": "https://app.chatwoot.com/" } ], - "tags": [ - { - "name": "CSAT Survey Page", - "description": "APIs for CSAT survey functionality" - } - ], "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" - } - } - } - } - } - } - }, - "/public/api/v1/inboxes/{inbox_identifier}": { - "parameters": [ - { - "$ref": "#/components/parameters/public_inbox_identifier" - } - ], - "get": { - "tags": [ - "Inbox API" - ], - "operationId": "get-details-of-a-inbox", - "summary": "Inbox details", - "description": "Get the details of an inbox", - "security": [ - - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/public_inbox" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "404": { - "description": "The given inbox does not exist", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, "/survey/responses/{conversation_uuid}": { "parameters": [ { @@ -1543,6147 +41,6 @@ } } } - }, - "/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": [ - "Contacts" - ], - "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": [ - "Contacts" - ], - "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}/contacts/{id}/contact_inboxes": { - "post": { - "tags": [ - "Contact" - ], - "operationId": "contactInboxCreation", - "description": "Create a contact inbox record for an inbox", - "summary": "Create contact inbox", - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "security": [ - { - "userApiKey": [ - - ] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number", - "description": "The ID of the inbox", - "example": 1 - }, - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contact_inboxes" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes": { - "get": { - "tags": [ - "Contact" - ], - "operationId": "contactableInboxesGet", - "description": "Get List of contactable Inboxes", - "summary": "Get Contactable Inboxes", - "security": [ - { - "userApiKey": [ - - ] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contactable_inboxes_response" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "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": [ - "Conversations" - ], - "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" - } - } - } - } - } - } - }, - "/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": { @@ -11912,8 +4269,72 @@ "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." + "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", + "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/platform_swagger.json b/swagger/tag_groups/platform_swagger.json index 6d54040ac..26b96db93 100644 --- a/swagger/tag_groups/platform_swagger.json +++ b/swagger/tag_groups/platform_swagger.json @@ -1,8 +1,8 @@ { "openapi": "3.0.4", "info": { - "title": "Chatwoot - Platform API", - "description": "Platform API endpoints for Chatwoot", + "title": "Chatwoot", + "description": "This is the API documentation for Chatwoot server.", "version": "1.1.0", "termsOfService": "https://www.chatwoot.com/terms-of-service/", "contact": { @@ -18,24 +18,6 @@ "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": { "/platform/api/v1/accounts": { "post": { @@ -852,6850 +834,6 @@ } } } - }, - "/public/api/v1/inboxes/{inbox_identifier}": { - "parameters": [ - { - "$ref": "#/components/parameters/public_inbox_identifier" - } - ], - "get": { - "tags": [ - "Inbox API" - ], - "operationId": "get-details-of-a-inbox", - "summary": "Inbox details", - "description": "Get the details of an inbox", - "security": [ - - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/public_inbox" - } - } - } - }, - "401": { - "description": "Unauthorized", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "404": { - "description": "The given inbox does not exist", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - }, - "/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" - } - } - } - }, - "/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": [ - "Contacts" - ], - "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": [ - "Contacts" - ], - "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}/contacts/{id}/contact_inboxes": { - "post": { - "tags": [ - "Contact" - ], - "operationId": "contactInboxCreation", - "description": "Create a contact inbox record for an inbox", - "summary": "Create contact inbox", - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "security": [ - { - "userApiKey": [ - - ] - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number", - "description": "The ID of the inbox", - "example": 1 - }, - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contact_inboxes" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - } - } - } - }, - "/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes": { - "get": { - "tags": [ - "Contact" - ], - "operationId": "contactableInboxesGet", - "description": "Get List of contactable Inboxes", - "summary": "Get Contactable Inboxes", - "security": [ - { - "userApiKey": [ - - ] - } - ], - "parameters": [ - { - "$ref": "#/components/parameters/account_id" - }, - { - "name": "id", - "in": "path", - "schema": { - "type": "number" - }, - "description": "ID of the contact", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/contactable_inboxes_response" - } - } - } - }, - "401": { - "description": "Authentication error", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/bad_request_error" - } - } - } - }, - "422": { - "description": "Incorrect payload", - "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": [ - "Conversations" - ], - "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" - } - } - } - } - } - } - }, - "/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": { @@ -11924,7 +5062,13 @@ "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." + "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", @@ -11933,5 +5077,69 @@ "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 Users management APIs" + }, + { + "name": "AgentBots", + "description": "Bot management APIs" + }, + { + "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", + "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