From 9a9398b3865cd2ab6ad28ae80eb5ec4bdc29932c Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 11 Mar 2026 07:03:55 +0530 Subject: [PATCH] feat: validate OpenAPI spec using Skooma (#13623) Adds Skooma-based OpenAPI validation so SDK-facing request specs can assert that documented request and response contracts match real Rails behavior. This also upgrades the spec to OpenAPI 3.1 and fixes contract drift uncovered while validating core application and platform resources. Closes None Why We want CI to catch OpenAPI drift before it reaches SDK consumers. While wiring validation in, this PR surfaced several mismatches between the documented contract and what the Rails endpoints actually accept or return. What this change does - Adds Skooma-backed OpenAPI validation to the request spec flow and a dedicated OpenAPI validation spec. - Migrates nullable schema definitions to OpenAPI 3.1-compatible unions. - Updates core SDK-facing schemas and payloads across accounts, contacts, conversations, inboxes, messages, teams, reporting events, and platform account resources. - Documents concrete runtime cases that were previously missing or inaccurate, including nested `profile` update payloads, multipart avatar uploads, required profile update bodies, nullable inbox feature flags, and message sender types that include both `Captain::Assistant` and senderless activity-style messages. - Regenerates the committed Swagger JSON and tag-group artifacts used by CI sync checks. Validation - `bundle exec rake swagger:build` - `bundle exec rspec spec/swagger/openapi_spec.rb` --------- Co-authored-by: Sojan Jose --- .circleci/config.yml | 4 +- Gemfile | 1 + Gemfile.lock | 11 + .../api/v1/accounts/agents_controller_spec.rb | 3 + .../v1/accounts/contacts_controller_spec.rb | 5 + .../conversations/messages_controller_spec.rb | 2 + .../accounts/conversations_controller_spec.rb | 7 + .../v1/accounts/inboxes_controller_spec.rb | 4 + .../api/v1/accounts/teams_controller_spec.rb | 4 + .../api/v1/accounts_controller_spec.rb | 50 +- .../api/v1/profiles_controller_spec.rb | 4 + .../api/v1/accounts_controller_spec.rb | 1 + spec/rails_helper.rb | 4 + spec/swagger/openapi_spec.rb | 7 + .../request/account/update_payload.yml | 15 +- .../request/conversation/create_payload.yml | 1 - .../definitions/resource/account_detail.yml | 20 +- .../resource/account_show_response.yml | 4 +- swagger/definitions/resource/agent.yml | 4 +- swagger/definitions/resource/audit_log.yml | 10 +- .../resource/contact_conversation_message.yml | 25 +- .../definitions/resource/contact_detail.yml | 14 +- .../definitions/resource/contact_inbox.yml | 7 +- .../resource/contact_list_item.yml | 24 +- swagger/definitions/resource/contact_meta.yml | 6 +- swagger/definitions/resource/conversation.yml | 27 +- .../resource/conversation_meta.yml | 12 +- .../extension/contact/conversation.yml | 16 +- swagger/definitions/resource/inbox.yml | 58 +- swagger/definitions/resource/message.yml | 48 +- .../definitions/resource/message_detailed.yml | 19 +- swagger/definitions/resource/portal_meta.yml | 15 +- .../definitions/resource/reporting_event.yml | 15 +- .../resource/reports/agent_summary.yml | 15 +- .../resource/reports/inbox_summary.yml | 15 +- .../resource/reports/team_summary.yml | 15 +- swagger/definitions/resource/team.yml | 4 +- swagger/definitions/resource/user.yml | 33 +- swagger/index.yml | 2 +- .../conversation/messages/index.yml | 8 +- .../paths/application/conversation/update.yml | 4 + swagger/paths/application/inboxes/index.yml | 35 + swagger/paths/application/inboxes/update.yml | 37 +- swagger/paths/index.yml | 6 +- swagger/paths/profile/index.yml | 77 ++ swagger/swagger.json | 900 +++++++++++++----- swagger/tag_groups/application.yml | 2 +- swagger/tag_groups/application_swagger.json | 900 +++++++++++++----- swagger/tag_groups/client.yml | 2 +- swagger/tag_groups/client_swagger.json | 634 ++++++++---- swagger/tag_groups/other_swagger.json | 634 ++++++++---- swagger/tag_groups/others.yml | 2 +- swagger/tag_groups/platform.yml | 2 +- swagger/tag_groups/platform_swagger.json | 634 ++++++++---- 54 files changed, 3216 insertions(+), 1192 deletions(-) create mode 100644 spec/swagger/openapi_spec.rb diff --git a/.circleci/config.yml b/.circleci/config.yml index 99ac1c29a..59702c139 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -93,8 +93,8 @@ jobs: exit 1 fi mkdir -p ~/tmp - curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.3.0/openapi-generator-cli-6.3.0.jar > ~/tmp/openapi-generator-cli-6.3.0.jar - java -jar ~/tmp/openapi-generator-cli-6.3.0.jar validate -i swagger/swagger.json + curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.19.0/openapi-generator-cli-7.19.0.jar > ~/tmp/openapi-generator-cli-7.19.0.jar + java -jar ~/tmp/openapi-generator-cli-7.19.0.jar validate -i swagger/swagger.json # Bundle audit - run: diff --git a/Gemfile b/Gemfile index 0636b7b2b..01c7a9f83 100644 --- a/Gemfile +++ b/Gemfile @@ -268,6 +268,7 @@ group :development, :test do gem 'seed_dump' gem 'shoulda-matchers' gem 'simplecov', '>= 0.21', require: false + gem 'skooma' gem 'spring' gem 'spring-watcher-listen' end diff --git a/Gemfile.lock b/Gemfile.lock index c32c2e5a7..cf07f32f6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -473,6 +473,12 @@ GEM hana (~> 1.3) regexp_parser (~> 2.0) uri_template (~> 0.7) + json_skooma (0.2.5) + bigdecimal + hana (~> 1.3) + regexp_parser (~> 2.0) + uri-idna (~> 0.2) + zeitwerk (~> 2.6) judoscale-rails (1.8.2) judoscale-ruby (= 1.8.2) railties @@ -910,6 +916,9 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.13.2) simplecov_json_formatter (0.1.4) + skooma (0.3.7) + json_skooma (~> 0.2.5) + zeitwerk (~> 2.6) slack-ruby-client (2.7.0) faraday (>= 2.0.1) faraday-mashify @@ -970,6 +979,7 @@ GEM unicode-emoji (4.0.4) uniform_notifier (1.17.0) uri (1.1.1) + uri-idna (0.3.1) uri_template (0.7.0) valid_email2 (5.2.6) activemodel (>= 3.2) @@ -1143,6 +1153,7 @@ DEPENDENCIES sidekiq_alive simplecov (>= 0.21) simplecov_json_formatter + skooma slack-ruby-client (~> 2.7.0) spring spring-watcher-listen diff --git a/spec/controllers/api/v1/accounts/agents_controller_spec.rb b/spec/controllers/api/v1/accounts/agents_controller_spec.rb index a74cbe21e..46b38677a 100644 --- a/spec/controllers/api/v1/accounts/agents_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/agents_controller_spec.rb @@ -25,6 +25,7 @@ RSpec.describe 'Agents API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.parsed_body.size).to eq(account.users.count) end @@ -122,6 +123,7 @@ RSpec.describe 'Agents API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(other_agent.reload.name).to eq(params[:name]) end @@ -171,6 +173,7 @@ RSpec.describe 'Agents API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.parsed_body['email']).to eq(params[:email]) expect(account.users.last.name).to eq('NewUser') end diff --git a/spec/controllers/api/v1/accounts/contacts_controller_spec.rb b/spec/controllers/api/v1/accounts/contacts_controller_spec.rb index 1b92d464f..d9ea3e641 100644 --- a/spec/controllers/api/v1/accounts/contacts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/contacts_controller_spec.rb @@ -45,6 +45,7 @@ RSpec.describe 'Contacts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) response_body = response.parsed_body contact_emails = response_body['payload'].pluck('email') contact_inboxes_source_ids = response_body['payload'].flat_map { |c| c['contact_inboxes'].pluck('source_id') } @@ -331,6 +332,7 @@ RSpec.describe 'Contacts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include(contact2.email) expect(response.body).not_to include(contact1.email) end @@ -443,6 +445,7 @@ RSpec.describe 'Contacts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include(contact2.email) expect(response.body).to include(contact1.email) end @@ -497,6 +500,7 @@ RSpec.describe 'Contacts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include(contact.name) end end @@ -620,6 +624,7 @@ RSpec.describe 'Contacts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(contact.reload.name).to eq('Test Blub') # custom attributes are merged properly without overwriting existing ones expect(contact.custom_attributes).to eq({ 'test' => 'new test', 'test1' => 'test1', 'test2' => 'test2' }) diff --git a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb index f7ff042e5..9ab8d7316 100644 --- a/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/conversations/messages_controller_spec.rb @@ -31,6 +31,7 @@ RSpec.describe 'Conversation Messages API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(conversation.messages.count).to eq(1) expect(conversation.messages.first.content).to eq(params[:content]) end @@ -182,6 +183,7 @@ RSpec.describe 'Conversation Messages API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(JSON.parse(response.body, symbolize_names: true)[:meta][:contact][:id]).to eq(conversation.contact_id) end end diff --git a/spec/controllers/api/v1/accounts/conversations_controller_spec.rb b/spec/controllers/api/v1/accounts/conversations_controller_spec.rb index 4b3d5cc5f..ab70d1c65 100644 --- a/spec/controllers/api/v1/accounts/conversations_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/conversations_controller_spec.rb @@ -27,6 +27,7 @@ RSpec.describe 'Conversations API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) body = JSON.parse(response.body, symbolize_names: true) expect(body[:data][:meta][:all_count]).to eq(1) expect(body[:data][:meta].keys).to include(:all_count, :mine_count, :assigned_count, :unassigned_count) @@ -165,6 +166,7 @@ RSpec.describe 'Conversations API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) response_data = JSON.parse(response.body, symbolize_names: true) expect(response_data.count).to eq(2) end @@ -234,6 +236,7 @@ RSpec.describe 'Conversations API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(JSON.parse(response.body, symbolize_names: true)[:id]).to eq(conversation.display_id) end @@ -282,6 +285,7 @@ RSpec.describe 'Conversations API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(JSON.parse(response.body, symbolize_names: true)[:priority]).to eq('high') end @@ -342,6 +346,7 @@ RSpec.describe 'Conversations API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) response_data = JSON.parse(response.body, symbolize_names: true) expect(response_data[:additional_attributes]).to eq(additional_attributes) end @@ -449,9 +454,11 @@ RSpec.describe 'Conversations API', type: :request do post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/toggle_status", headers: agent.create_new_auth_token, + params: { status: 'open' }, as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(conversation.reload.status).to eq('open') end diff --git a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb index b93ca8ecf..8aae60d53 100644 --- a/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/inboxes_controller_spec.rb @@ -32,6 +32,7 @@ RSpec.describe 'Inboxes API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(JSON.parse(response.body, symbolize_names: true)[:payload].size).to eq(2) end @@ -95,6 +96,7 @@ RSpec.describe 'Inboxes API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(JSON.parse(response.body, symbolize_names: true)[:id]).to eq(inbox.id) end @@ -383,6 +385,7 @@ RSpec.describe 'Inboxes API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include('test.com') end @@ -478,6 +481,7 @@ RSpec.describe 'Inboxes API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(inbox.reload.enable_auto_assignment).to be_falsey expect(inbox.reload.portal_id).to eq(portal.id) expect(response.parsed_body['name']).to eq 'new test inbox' diff --git a/spec/controllers/api/v1/accounts/teams_controller_spec.rb b/spec/controllers/api/v1/accounts/teams_controller_spec.rb index 347510db6..78ae78696 100644 --- a/spec/controllers/api/v1/accounts/teams_controller_spec.rb +++ b/spec/controllers/api/v1/accounts/teams_controller_spec.rb @@ -22,6 +22,7 @@ RSpec.describe 'Teams API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.parsed_body.first['id']).to eq(account.teams.first.id) end end @@ -45,6 +46,7 @@ RSpec.describe 'Teams API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.parsed_body['id']).to eq(team.id) end end @@ -83,6 +85,7 @@ RSpec.describe 'Teams API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(Team.count).to eq(2) end end @@ -121,6 +124,7 @@ RSpec.describe 'Teams API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(team.reload.name).to eq('new-team') end end diff --git a/spec/controllers/api/v1/accounts_controller_spec.rb b/spec/controllers/api/v1/accounts_controller_spec.rb index d773cafa7..d76f22187 100644 --- a/spec/controllers/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/api/v1/accounts_controller_spec.rb @@ -149,6 +149,7 @@ RSpec.describe 'Accounts API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include(account.name) expect(response.body).to include(account.locale) expect(response.body).to include(account.domain) @@ -184,22 +185,22 @@ RSpec.describe 'Accounts API', type: :request do end end - describe 'PUT /api/v1/accounts/{account.id}' do + describe 'PATCH /api/v1/accounts/{account.id}' do let(:account) { create(:account) } let(:agent) { create(:user, account: account, role: :agent) } let(:admin) { create(:user, account: account, role: :administrator) } context 'when it is an unauthenticated user' do it 'returns unauthorized' do - put "/api/v1/accounts/#{account.id}" + patch "/api/v1/accounts/#{account.id}" expect(response).to have_http_status(:unauthorized) end end context 'when it is an unauthorized user' do it 'returns unauthorized' do - put "/api/v1/accounts/#{account.id}", - headers: agent.create_new_auth_token + patch "/api/v1/accounts/#{account.id}", + headers: agent.create_new_auth_token expect(response).to have_http_status(:unauthorized) end @@ -219,11 +220,20 @@ RSpec.describe 'Accounts API', type: :request do company_size: '1-10' } + it 'returns a valid schema' do + patch "/api/v1/accounts/#{account.id}", + params: params, + headers: admin.create_new_auth_token, + as: :json + + expect(response).to conform_schema(200) + end + it 'modifies an account' do - put "/api/v1/accounts/#{account.id}", - params: params, - headers: admin.create_new_auth_token, - as: :json + patch "/api/v1/accounts/#{account.id}", + params: params, + headers: admin.create_new_auth_token, + as: :json expect(response).to have_http_status(:success) expect(account.reload.name).to eq(params[:name]) @@ -242,19 +252,19 @@ RSpec.describe 'Accounts API', type: :request do it 'updates onboarding step to invite_team if onboarding step is present in account custom attributes' do account.update(custom_attributes: { onboarding_step: 'account_update' }) - put "/api/v1/accounts/#{account.id}", - params: params, - headers: admin.create_new_auth_token, - as: :json + patch "/api/v1/accounts/#{account.id}", + params: params, + headers: admin.create_new_auth_token, + as: :json expect(account.reload.custom_attributes['onboarding_step']).to eq('invite_team') end it 'will not update onboarding step if onboarding step is not present in account custom attributes' do - put "/api/v1/accounts/#{account.id}", - params: params, - headers: admin.create_new_auth_token, - as: :json + patch "/api/v1/accounts/#{account.id}", + params: params, + headers: admin.create_new_auth_token, + as: :json expect(account.reload.custom_attributes['onboarding_step']).to be_nil end @@ -262,10 +272,10 @@ RSpec.describe 'Accounts API', type: :request do it 'Throws error 422' do params[:name] = 'test' * 999 - put "/api/v1/accounts/#{account.id}", - params: params, - headers: admin.create_new_auth_token, - as: :json + patch "/api/v1/accounts/#{account.id}", + params: params, + headers: admin.create_new_auth_token, + as: :json expect(response).to have_http_status(:unprocessable_entity) json_response = response.parsed_body diff --git a/spec/controllers/api/v1/profiles_controller_spec.rb b/spec/controllers/api/v1/profiles_controller_spec.rb index 30c5b69f4..19054b523 100644 --- a/spec/controllers/api/v1/profiles_controller_spec.rb +++ b/spec/controllers/api/v1/profiles_controller_spec.rb @@ -21,6 +21,7 @@ RSpec.describe 'Profile API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) json_response = response.parsed_body expect(json_response['id']).to eq(agent.id) expect(json_response['email']).to eq(agent.email) @@ -50,6 +51,7 @@ RSpec.describe 'Profile API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) json_response = response.parsed_body agent.reload expect(json_response['id']).to eq(agent.id) @@ -64,6 +66,7 @@ RSpec.describe 'Profile API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) agent.reload expect(agent.custom_attributes['phone_number']).to eq('+123456789') @@ -91,6 +94,7 @@ RSpec.describe 'Profile API', type: :request do as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(agent.reload.valid_password?('Test1234!')).to be true end diff --git a/spec/controllers/platform/api/v1/accounts_controller_spec.rb b/spec/controllers/platform/api/v1/accounts_controller_spec.rb index 63f53d0d6..6c95a0209 100644 --- a/spec/controllers/platform/api/v1/accounts_controller_spec.rb +++ b/spec/controllers/platform/api/v1/accounts_controller_spec.rb @@ -144,6 +144,7 @@ RSpec.describe 'Platform Accounts API', type: :request do headers: { api_access_token: platform_app.access_token.token }, as: :json expect(response).to have_http_status(:success) + expect(response).to conform_schema(200) expect(response.body).to include(account.name) end end diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index bb8ea89e1..d863dd58c 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -75,6 +75,10 @@ RSpec.configure do |config| config.include ActiveSupport::Testing::TimeHelpers config.include ActionCable::TestHelper config.include ActiveJob::TestHelper + + # OpenAPI response validation via Skooma + path_to_openapi = Rails.root.join('swagger/swagger.json') + config.include Skooma::RSpec[path_to_openapi], type: :request end Shoulda::Matchers.configure do |config| diff --git a/spec/swagger/openapi_spec.rb b/spec/swagger/openapi_spec.rb new file mode 100644 index 000000000..330f832ea --- /dev/null +++ b/spec/swagger/openapi_spec.rb @@ -0,0 +1,7 @@ +require 'rails_helper' + +RSpec.describe 'OpenAPI document', type: :request do + it 'is valid against the OpenAPI 3.1.0 meta-schema' do + expect(skooma_openapi_schema).to be_valid_document + end +end diff --git a/swagger/definitions/request/account/update_payload.yml b/swagger/definitions/request/account/update_payload.yml index b2e47cbc2..4b907ed99 100644 --- a/swagger/definitions/request/account/update_payload.yml +++ b/swagger/definitions/request/account/update_payload.yml @@ -18,20 +18,23 @@ properties: example: 'support@example.com' # Settings parameters (stored in settings JSONB column) auto_resolve_after: - type: integer + type: + - integer + - 'null' minimum: 10 maximum: 1439856 - nullable: true description: Auto resolve conversations after specified minutes example: 1440 auto_resolve_message: - type: string - nullable: true + type: + - string + - 'null' description: Message to send when auto resolving example: "This conversation has been automatically resolved due to inactivity" auto_resolve_ignore_waiting: - type: boolean - nullable: true + type: + - boolean + - 'null' description: Whether to ignore waiting conversations for auto resolve example: false # Custom attributes parameters (stored in custom_attributes JSONB column) diff --git a/swagger/definitions/request/conversation/create_payload.yml b/swagger/definitions/request/conversation/create_payload.yml index c0cc75c46..a5e41f66f 100644 --- a/swagger/definitions/request/conversation/create_payload.yml +++ b/swagger/definitions/request/conversation/create_payload.yml @@ -1,7 +1,6 @@ type: object required: - source_id - - inbox_id properties: source_id: type: string diff --git a/swagger/definitions/resource/account_detail.yml b/swagger/definitions/resource/account_detail.yml index 0ff463bae..19b927157 100644 --- a/swagger/definitions/resource/account_detail.yml +++ b/swagger/definitions/resource/account_detail.yml @@ -26,9 +26,7 @@ properties: type: object description: Cache keys for the account features: - type: array - items: - type: string + type: object description: Enabled features for the account settings: type: object @@ -48,16 +46,24 @@ properties: description: Custom attributes of the account properties: plan_name: - type: string + type: + - string + - 'null' description: Subscription plan name subscribed_quantity: - type: number + type: + - number + - 'null' description: Subscribed quantity subscription_status: - type: string + type: + - string + - 'null' description: Subscription status subscription_ends_on: - type: string + type: + - string + - 'null' format: date description: Subscription end date industry: diff --git a/swagger/definitions/resource/account_show_response.yml b/swagger/definitions/resource/account_show_response.yml index 208b27218..7def2290d 100644 --- a/swagger/definitions/resource/account_show_response.yml +++ b/swagger/definitions/resource/account_show_response.yml @@ -3,7 +3,9 @@ allOf: - type: object properties: latest_chatwoot_version: - type: string + type: + - string + - 'null' description: Latest version of Chatwoot available example: "3.0.0" subscribed_features: diff --git a/swagger/definitions/resource/agent.yml b/swagger/definitions/resource/agent.yml index 5287f3e6f..1d7b2b4c3 100644 --- a/swagger/definitions/resource/agent.yml +++ b/swagger/definitions/resource/agent.yml @@ -31,5 +31,7 @@ properties: type: string description: The thumbnail of the agent custom_role_id: - type: integer + type: + - integer + - 'null' description: The custom role id of the agent diff --git a/swagger/definitions/resource/audit_log.yml b/swagger/definitions/resource/audit_log.yml index 9dfa63263..10bbfc285 100644 --- a/swagger/definitions/resource/audit_log.yml +++ b/swagger/definitions/resource/audit_log.yml @@ -38,8 +38,9 @@ properties: type: integer description: Version number of the audit log entry comment: - type: string - nullable: true + type: + - string + - 'null' description: Optional comment associated with the audit log entry request_uuid: type: string @@ -48,6 +49,7 @@ properties: type: integer description: Unix timestamp when the audit log entry was created remote_address: - type: string - nullable: true + type: + - string + - 'null' description: IP address from which the action was performed \ No newline at end of file diff --git a/swagger/definitions/resource/contact_conversation_message.yml b/swagger/definitions/resource/contact_conversation_message.yml index e95923e52..a0334dfba 100644 --- a/swagger/definitions/resource/contact_conversation_message.yml +++ b/swagger/definitions/resource/contact_conversation_message.yml @@ -31,9 +31,10 @@ properties: type: string description: Status of the message source_id: - type: string + type: + - string + - 'null' description: Source ID of the message - nullable: true content_type: type: string description: Type of the content @@ -41,13 +42,15 @@ properties: type: object description: Attributes of the content sender_type: - type: string + type: + - string + - 'null' description: Type of the sender - nullable: true sender_id: - type: integer + type: + - integer + - 'null' description: ID of the sender - nullable: true external_source_ids: type: object description: External source IDs @@ -55,9 +58,10 @@ properties: type: object description: Additional attributes of the message processed_message_content: - type: string + type: + - string + - 'null' description: Processed message content - nullable: true sentiment: type: object description: Sentiment analysis of the message @@ -66,9 +70,10 @@ properties: description: Conversation details properties: assignee_id: - type: integer + type: + - integer + - 'null' description: ID of the assignee - nullable: true unread_count: type: integer description: Count of unread messages diff --git a/swagger/definitions/resource/contact_detail.yml b/swagger/definitions/resource/contact_detail.yml index 060c91214..705868192 100644 --- a/swagger/definitions/resource/contact_detail.yml +++ b/swagger/definitions/resource/contact_detail.yml @@ -11,7 +11,9 @@ properties: type: string description: Country of the contact country_code: - type: string + type: + - string + - 'null' description: Country code of the contact created_at_ip: type: string @@ -26,16 +28,18 @@ properties: type: integer description: The ID of the contact identifier: - type: string + type: + - string + - 'null' description: The identifier of the contact - nullable: true name: type: string description: The name of the contact phone_number: - type: string + type: + - string + - 'null' description: The phone number of the contact - nullable: true thumbnail: type: string description: The thumbnail of the contact diff --git a/swagger/definitions/resource/contact_inbox.yml b/swagger/definitions/resource/contact_inbox.yml index 34fd374f2..a5a4eabb9 100644 --- a/swagger/definitions/resource/contact_inbox.yml +++ b/swagger/definitions/resource/contact_inbox.yml @@ -22,6 +22,7 @@ properties: type: string description: Type of channel provider: - type: string - description: Provider of the inbox - nullable: true \ No newline at end of file + type: + - string + - 'null' + description: Provider of the inbox \ No newline at end of file diff --git a/swagger/definitions/resource/contact_list_item.yml b/swagger/definitions/resource/contact_list_item.yml index 7765b2265..1be9c6630 100644 --- a/swagger/definitions/resource/contact_list_item.yml +++ b/swagger/definitions/resource/contact_list_item.yml @@ -11,7 +11,9 @@ properties: type: string description: Country of the contact country_code: - type: string + type: + - string + - 'null' description: Country code of the contact created_at_ip: type: string @@ -21,9 +23,10 @@ properties: description: Availability status of the contact enum: ["online", "offline"] email: - type: string + type: + - string + - 'null' description: The email address of the contact - nullable: true id: type: integer description: The ID of the contact @@ -31,16 +34,18 @@ properties: type: string description: The name of the contact phone_number: - type: string + type: + - string + - 'null' description: The phone number of the contact - nullable: true blocked: type: boolean description: Whether the contact is blocked identifier: - type: string + type: + - string + - 'null' description: The identifier of the contact - nullable: true thumbnail: type: string description: The thumbnail of the contact @@ -48,9 +53,10 @@ properties: type: object description: The custom attributes of the contact last_activity_at: - type: integer + type: + - integer + - 'null' description: Timestamp of last activity - nullable: true created_at: type: integer description: Timestamp when contact was created diff --git a/swagger/definitions/resource/contact_meta.yml b/swagger/definitions/resource/contact_meta.yml index f7139b9d2..e718aaa22 100644 --- a/swagger/definitions/resource/contact_meta.yml +++ b/swagger/definitions/resource/contact_meta.yml @@ -4,5 +4,7 @@ properties: type: integer description: Total number of contacts current_page: - type: string - description: Current page number \ No newline at end of file + type: + - string + - integer + description: Current page number \ No newline at end of file diff --git a/swagger/definitions/resource/conversation.yml b/swagger/definitions/resource/conversation.yml index c1577e693..a0bc7730b 100644 --- a/swagger/definitions/resource/conversation.yml +++ b/swagger/definitions/resource/conversation.yml @@ -43,7 +43,9 @@ properties: type: boolean description: Whether the conversation is muted snoozed_until: - type: number + type: + - number + - 'null' description: The time at which the conversation will be unmuted status: type: string @@ -56,29 +58,38 @@ properties: type: number description: The time at which conversation was updated timestamp: - type: string + type: number description: The time at which conversation was created first_reply_created_at: - type: number + type: + - number + - 'null' description: The time at which the first reply was created unread_count: type: number description: The number of unread messages last_non_activity_message: - type: object - $ref: '#/components/schemas/message' + oneOf: + - $ref: '#/components/schemas/message' + - type: 'null' description: The last non activity message last_activity_at: type: number description: The last activity at of the conversation priority: - type: string + type: + - string + - 'null' description: The priority of the conversation waiting_since: - type: number + type: + - number + - 'null' description: The time at which the conversation was waiting sla_policy_id: - type: number + type: + - number + - 'null' description: The ID of the SLA policy applied_sla: type: object diff --git a/swagger/definitions/resource/conversation_meta.yml b/swagger/definitions/resource/conversation_meta.yml index 02ac2390f..a0a4a6200 100644 --- a/swagger/definitions/resource/conversation_meta.yml +++ b/swagger/definitions/resource/conversation_meta.yml @@ -51,10 +51,12 @@ properties: description: The agent assigned to the conversation nullable: true agent_last_seen_at: - type: string + type: + - string + - 'null' description: Timestamp when the agent last saw the conversation - nullable: true assignee_last_seen_at: - type: string - description: Timestamp when the assignee last saw the conversation - nullable: true \ No newline at end of file + type: + - string + - 'null' + description: Timestamp when the assignee last saw the conversation \ No newline at end of file diff --git a/swagger/definitions/resource/extension/contact/conversation.yml b/swagger/definitions/resource/extension/contact/conversation.yml index ef1b0eb75..e58e5d165 100644 --- a/swagger/definitions/resource/extension/contact/conversation.yml +++ b/swagger/definitions/resource/extension/contact/conversation.yml @@ -13,7 +13,9 @@ properties: type: string description: The availability status of the sender email: - type: string + type: + - string + - 'null' description: The email of the sender id: type: number @@ -22,16 +24,22 @@ properties: type: string description: The name of the sender phone_number: - type: string + type: + - string + - 'null' description: The phone number of the sender blocked: type: boolean description: Whether the sender is blocked identifier: - type: string + type: + - string + - 'null' description: The identifier of the sender thumbnail: - type: string + type: + - string + - 'null' description: Avatar URL of the contact custom_attributes: type: object diff --git a/swagger/definitions/resource/inbox.yml b/swagger/definitions/resource/inbox.yml index 88f5ea288..5ba6b49bb 100644 --- a/swagger/definitions/resource/inbox.yml +++ b/swagger/definitions/resource/inbox.yml @@ -28,16 +28,22 @@ properties: type: string description: Script used to load the website widget welcome_title: - type: string + type: + - string + - 'null' description: Welcome title to be displayed on the widget welcome_tagline: - type: string + type: + - string + - 'null' description: Welcome tagline to be displayed on the widget greeting_enabled: type: boolean description: The flag which shows whether greeting is enabled greeting_message: - type: string + type: + - string + - 'null' description: A greeting message when the user starts the conversation channel_id: type: number @@ -55,7 +61,9 @@ properties: type: object description: Configuration settings for auto assignment out_of_office_message: - type: string + type: + - string + - 'null' description: Message to show when agents are out of office working_hours: type: array @@ -70,16 +78,24 @@ properties: type: boolean description: Whether the inbox is closed for the entire day open_hour: - type: number + type: + - number + - 'null' description: Hour when inbox opens (0-23) open_minutes: - type: number + type: + - number + - 'null' description: Minutes of the hour when inbox opens (0-59) close_hour: - type: number + type: + - number + - 'null' description: Hour when inbox closes (0-23) close_minutes: - type: number + type: + - number + - 'null' description: Minutes of the hour when inbox closes (0-59) open_all_day: type: boolean @@ -88,7 +104,9 @@ properties: type: string description: Timezone configuration for the inbox callback_webhook_url: - type: string + type: + - string + - 'null' description: Webhook URL for callbacks allow_messages_after_resolved: type: boolean @@ -100,26 +118,38 @@ properties: type: string description: Type of sender name to display (e.g., friendly) business_name: - type: string + type: + - string + - 'null' description: Business name associated with the inbox hmac_mandatory: type: boolean description: Whether HMAC verification is mandatory selected_feature_flags: - type: object + type: + - array + - 'null' description: Selected feature flags for the inbox + items: + type: string reply_time: type: string description: Expected reply time messaging_service_sid: - type: string + type: + - string + - 'null' description: Messaging service SID for SMS providers phone_number: - type: string + type: + - string + - 'null' description: Phone number associated with the inbox medium: type: string description: Medium of communication (e.g., sms, email) provider: - type: string + type: + - string + - 'null' description: Provider of the channel diff --git a/swagger/definitions/resource/message.yml b/swagger/definitions/resource/message.yml index f31936295..a1f598bc8 100644 --- a/swagger/definitions/resource/message.yml +++ b/swagger/definitions/resource/message.yml @@ -17,37 +17,49 @@ properties: description: The ID of the conversation message_type: type: integer - enum: [0, 1, 2] + enum: [0, 1, 2, 3] description: The type of the message created_at: type: integer description: The time at which message was created updated_at: - type: integer + type: + - integer + - string description: The time at which message was updated private: type: boolean description: The flags which shows whether the message is private or not status: - type: string - enum: ["sent", "delivered", "read", "failed"] + type: + - string + - 'null' + enum: ["sent", "delivered", "read", "failed", null] description: The status of the message source_id: - type: string + type: + - string + - 'null' description: The source ID of the message content_type: - type: string - enum: ["text", "input_select", "cards", "form"] + type: + - string + - 'null' + enum: ["text", "input_text", "input_textarea", "input_email", "input_select", "cards", "form", "article", "incoming_email", "input_csat", "integrations", "sticker", "voice_call", null] description: The type of the template message content_attributes: type: object description: The content attributes for each content_type sender_type: - type: string - enum: ["contact", "agent", "agent_bot"] + type: + - string + - 'null' + enum: ["Contact", "User", "AgentBot", "Captain::Assistant", null] description: The type of the sender sender_id: - type: number + type: + - number + - 'null' description: The ID of the sender external_source_ids: type: object @@ -56,16 +68,24 @@ properties: type: object description: The additional attributes of the message processed_message_content: - type: string + type: + - string + - 'null' description: The processed message content sentiment: - type: object + type: + - object + - 'null' description: The sentiment of the message conversation: - type: object + type: + - object + - 'null' description: The conversation object attachment: - type: object + type: + - object + - 'null' description: The file object attached to the image sender: type: object diff --git a/swagger/definitions/resource/message_detailed.yml b/swagger/definitions/resource/message_detailed.yml index 8c7e9c3d1..9f9e45fc3 100644 --- a/swagger/definitions/resource/message_detailed.yml +++ b/swagger/definitions/resource/message_detailed.yml @@ -18,7 +18,7 @@ properties: description: "The type of the message (0: incoming, 1: outgoing, 2: activity, 3: template)" content_type: type: string - enum: ["text", "input_select", "cards", "form", "input_csat"] + enum: ["text", "input_text", "input_textarea", "input_email", "input_select", "cards", "form", "article", "incoming_email", "input_csat", "integrations", "sticker", "voice_call"] description: The type of the message content status: type: string @@ -29,13 +29,15 @@ properties: description: The content attributes for each content_type properties: in_reply_to: - type: string + type: + - string + - 'null' description: ID of the message this is replying to - nullable: true echo_id: - type: string + type: + - string + - 'null' description: The echo ID of the message, used for deduplication - nullable: true created_at: type: integer description: The timestamp when message was created @@ -43,9 +45,10 @@ properties: type: boolean description: The flag which shows whether the message is private or not source_id: - type: string + type: + - string + - 'null' description: The source ID of the message - nullable: true sender: $ref: '#/components/schemas/contact_detail' description: The sender of the message (only for incoming messages) @@ -76,4 +79,4 @@ properties: description: The thumbnail URL of the attached file file_size: type: number - description: The size of the attached file in bytes \ No newline at end of file + description: The size of the attached file in bytes diff --git a/swagger/definitions/resource/portal_meta.yml b/swagger/definitions/resource/portal_meta.yml index 64b44fc99..db67cc333 100644 --- a/swagger/definitions/resource/portal_meta.yml +++ b/swagger/definitions/resource/portal_meta.yml @@ -4,16 +4,19 @@ properties: type: integer description: Total number of articles archived_articles_count: - type: integer - nullable: true + type: + - integer + - 'null' description: Number of archived articles published_count: - type: integer - nullable: true + type: + - integer + - 'null' description: Number of published articles draft_articles_count: - type: integer - nullable: true + type: + - integer + - 'null' description: Number of draft articles categories_count: type: integer diff --git a/swagger/definitions/resource/reporting_event.yml b/swagger/definitions/resource/reporting_event.yml index 85cf71b8c..cea859db5 100644 --- a/swagger/definitions/resource/reporting_event.yml +++ b/swagger/definitions/resource/reporting_event.yml @@ -26,16 +26,19 @@ properties: type: number description: ID of the account conversation_id: - type: number - nullable: true + type: + - number + - 'null' description: ID of the conversation inbox_id: - type: number - nullable: true + type: + - number + - 'null' description: ID of the inbox user_id: - type: number - nullable: true + type: + - number + - 'null' description: ID of the user/agent created_at: type: string diff --git a/swagger/definitions/resource/reports/agent_summary.yml b/swagger/definitions/resource/reports/agent_summary.yml index 47c632ddf..db7e9d66a 100644 --- a/swagger/definitions/resource/reports/agent_summary.yml +++ b/swagger/definitions/resource/reports/agent_summary.yml @@ -13,16 +13,19 @@ items: type: number description: Number of conversations resolved by the agent during the date range avg_resolution_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) to resolve conversations. Null if no data available. avg_first_response_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) for the first response. Null if no data available. avg_reply_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) between replies. Null if no data available. example: - id: 1 diff --git a/swagger/definitions/resource/reports/inbox_summary.yml b/swagger/definitions/resource/reports/inbox_summary.yml index 9a9adcf6b..badf64328 100644 --- a/swagger/definitions/resource/reports/inbox_summary.yml +++ b/swagger/definitions/resource/reports/inbox_summary.yml @@ -13,16 +13,19 @@ items: type: number description: Number of conversations resolved in the inbox during the date range avg_resolution_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) to resolve conversations. Null if no data available. avg_first_response_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) for the first response. Null if no data available. avg_reply_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) between replies. Null if no data available. example: - id: 1 diff --git a/swagger/definitions/resource/reports/team_summary.yml b/swagger/definitions/resource/reports/team_summary.yml index 98f5895a9..40ec48265 100644 --- a/swagger/definitions/resource/reports/team_summary.yml +++ b/swagger/definitions/resource/reports/team_summary.yml @@ -13,16 +13,19 @@ items: type: number description: Number of conversations resolved by the team during the date range avg_resolution_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) to resolve conversations. Null if no data available. avg_first_response_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) for the first response. Null if no data available. avg_reply_time: - type: number - nullable: true + type: + - number + - 'null' description: Average time (in seconds) between replies. Null if no data available. example: - id: 1 diff --git a/swagger/definitions/resource/team.yml b/swagger/definitions/resource/team.yml index eda41ed3e..d02d70e23 100644 --- a/swagger/definitions/resource/team.yml +++ b/swagger/definitions/resource/team.yml @@ -7,7 +7,9 @@ properties: type: string description: The name of the team description: - type: string + type: + - string + - 'null' description: The description about the team allow_auto_assign: type: boolean diff --git a/swagger/definitions/resource/user.yml b/swagger/definitions/resource/user.yml index 329dba12e..50bba19a1 100644 --- a/swagger/definitions/resource/user.yml +++ b/swagger/definitions/resource/user.yml @@ -13,17 +13,21 @@ properties: confirmed: type: boolean display_name: - type: string - nullable: true + type: + - string + - 'null' message_signature: - type: string - nullable: true + type: + - string + - 'null' email: type: string hmac_identifier: type: string inviter_id: - type: number + type: + - number + - 'null' name: type: string provider: @@ -38,8 +42,9 @@ properties: uid: type: string type: - type: string - nullable: true + type: + - string + - 'null' custom_attributes: type: object description: Available for users who are created through platform APIs and has custom attributes associated. @@ -55,7 +60,9 @@ properties: status: type: string active_at: - type: string + type: + - string + - 'null' format: date-time role: type: string @@ -71,8 +78,10 @@ properties: auto_offline: type: boolean custom_role_id: - type: number - nullable: true + type: + - number + - 'null' custom_role: - type: object - nullable: true + type: + - object + - 'null' diff --git a/swagger/index.yml b/swagger/index.yml index dd460d111..475f4126c 100644 --- a/swagger/index.yml +++ b/swagger/index.yml @@ -1,4 +1,4 @@ -openapi: '3.0.4' +openapi: '3.1.0' info: title: Chatwoot description: This is the API documentation for Chatwoot server. diff --git a/swagger/paths/application/conversation/messages/index.yml b/swagger/paths/application/conversation/messages/index.yml index 68aa120fc..6dd7321f9 100644 --- a/swagger/paths/application/conversation/messages/index.yml +++ b/swagger/paths/application/conversation/messages/index.yml @@ -38,10 +38,14 @@ responses: assignee: $ref: '#/components/schemas/agent' agent_last_seen_at: - type: string + type: + - string + - 'null' format: date-time assignee_last_seen_at: - type: string + type: + - string + - 'null' format: date-time payload: type: array diff --git a/swagger/paths/application/conversation/update.yml b/swagger/paths/application/conversation/update.yml index fbe8e668b..45f8887a4 100644 --- a/swagger/paths/application/conversation/update.yml +++ b/swagger/paths/application/conversation/update.yml @@ -25,6 +25,10 @@ requestBody: responses: '200': description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/conversation' '401': description: Unauthorized content: diff --git a/swagger/paths/application/inboxes/index.yml b/swagger/paths/application/inboxes/index.yml index 89abb6009..3d9f4b4e0 100644 --- a/swagger/paths/application/inboxes/index.yml +++ b/swagger/paths/application/inboxes/index.yml @@ -33,3 +33,38 @@ get: application/json: schema: $ref: '#/components/schemas/bad_request_error' +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' diff --git a/swagger/paths/application/inboxes/update.yml b/swagger/paths/application/inboxes/update.yml index e076dd532..912335861 100644 --- a/swagger/paths/application/inboxes/update.yml +++ b/swagger/paths/application/inboxes/update.yml @@ -1,3 +1,38 @@ +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' patch: tags: - Inboxes @@ -26,8 +61,6 @@ patch: content: application/json: schema: - type: object - description: 'Updated inbox object' $ref: '#/components/schemas/inbox' '404': description: Inbox not found diff --git a/swagger/paths/index.yml b/swagger/paths/index.yml index 3f8bab7d9..b8b507d91 100644 --- a/swagger/paths/index.yml +++ b/swagger/paths/index.yml @@ -167,7 +167,7 @@ # ------------ Application API routes ------------# # Accounts -/api/v1/accounts/{id}: +/api/v1/accounts/{account_id}: parameters: - $ref: '#/components/parameters/account_id' get: @@ -413,10 +413,6 @@ # Inboxes /api/v1/accounts/{account_id}/inboxes: $ref: ./application/inboxes/index.yml -/api/v1/accounts/{account_id}/inboxes/{id}/: - $ref: ./application/inboxes/show.yml -/api/v1/accounts/{account_id}/inboxes/: - $ref: ./application/inboxes/create.yml /api/v1/accounts/{account_id}/inboxes/{id}: $ref: ./application/inboxes/update.yml /api/v1/accounts/{account_id}/inboxes/{id}/agent_bot: diff --git a/swagger/paths/profile/index.yml b/swagger/paths/profile/index.yml index 17eda92d0..1896fd5f8 100644 --- a/swagger/paths/profile/index.yml +++ b/swagger/paths/profile/index.yml @@ -19,3 +19,80 @@ get: application/json: schema: $ref: '#/components/schemas/bad_request_error' +put: + tags: + - Profile + operationId: updateProfile + summary: Update user profile + description: Update the user profile details + security: + - userApiKey: [] + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - profile + properties: + profile: + type: object + properties: + name: + type: string + email: + type: string + display_name: + type: string + message_signature: + type: string + phone_number: + type: string + current_password: + type: string + password: + type: string + password_confirmation: + type: string + ui_settings: + type: object + multipart/form-data: + schema: + type: object + required: + - profile + properties: + profile: + type: object + properties: + name: + type: string + email: + type: string + display_name: + type: string + message_signature: + type: string + phone_number: + type: string + current_password: + type: string + password: + type: string + password_confirmation: + type: string + avatar: + type: string + format: binary + ui_settings: + type: object + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': + description: Unauthorized diff --git a/swagger/swagger.json b/swagger/swagger.json index e11376bcf..c24d7fd04 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.4", + "openapi": "3.1.0", "info": { "title": "Chatwoot", "description": "This is the API documentation for Chatwoot server.", @@ -1476,7 +1476,7 @@ } } }, - "/api/v1/accounts/{id}": { + "/api/v1/accounts/{account_id}": { "parameters": [ { "$ref": "#/components/parameters/account_id" @@ -4721,7 +4721,14 @@ }, "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation" + } + } + } }, "401": { "description": "Unauthorized", @@ -5426,70 +5433,7 @@ } } } - } - }, - "/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" @@ -5552,6 +5496,65 @@ } }, "/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" + } + } + } + } + } + }, "patch": { "tags": [ "Inboxes" @@ -6164,11 +6167,17 @@ "$ref": "#/components/schemas/agent" }, "agent_last_seen_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "assignee_last_seen_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" } } @@ -6573,6 +6582,127 @@ } } } + }, + "put": { + "tags": [ + "Profile" + ], + "operationId": "updateProfile", + "summary": "Update user profile", + "description": "Update the user profile details", + "security": [ + { + "userApiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "profile" + ], + "properties": { + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "message_signature": { + "type": "string" + }, + "phone_number": { + "type": "string" + }, + "current_password": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_confirmation": { + "type": "string" + }, + "ui_settings": { + "type": "object" + } + } + } + } + } + }, + "multipart/form-data": { + "schema": { + "type": "object", + "required": [ + "profile" + ], + "properties": { + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "message_signature": { + "type": "string" + }, + "phone_number": { + "type": "string" + }, + "current_password": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_confirmation": { + "type": "string" + }, + "avatar": { + "type": "string", + "format": "binary" + }, + "ui_settings": { + "type": "object" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + } } }, "/api/v1/accounts/{account_id}/teams": { @@ -8816,18 +8946,24 @@ "description": "Total number of articles" }, "archived_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of archived articles" }, "published_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of published articles" }, "draft_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of draft articles" }, "categories_count": { @@ -9121,7 +9257,10 @@ "description": "Whether the conversation is muted" }, "snoozed_until": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation will be unmuted" }, "status": { @@ -9142,11 +9281,14 @@ "description": "The time at which conversation was updated" }, "timestamp": { - "type": "string", + "type": "number", "description": "The time at which conversation was created" }, "first_reply_created_at": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the first reply was created" }, "unread_count": { @@ -9154,22 +9296,39 @@ "description": "The number of unread messages" }, "last_non_activity_message": { - "$ref": "#/components/schemas/message" + "oneOf": [ + { + "$ref": "#/components/schemas/message" + }, + { + "type": "null" + } + ], + "description": "The last non activity message" }, "last_activity_at": { "type": "number", "description": "The last activity at of the conversation" }, "priority": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The priority of the conversation" }, "waiting_since": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation was waiting" }, "sla_policy_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the SLA policy" }, "applied_sla": { @@ -9213,7 +9372,8 @@ "enum": [ 0, 1, - 2 + 2, + 3 ], "description": "The type of the message" }, @@ -9222,7 +9382,10 @@ "description": "The time at which message was created" }, "updated_at": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "The time at which message was updated" }, "private": { @@ -9230,26 +9393,46 @@ "description": "The flags which shows whether the message is private or not" }, "status": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "sent", "delivered", "read", - "failed" + "failed", + null ], "description": "The status of the message" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The source ID of the message" }, "content_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", - "form" + "form", + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call", + null ], "description": "The type of the template message" }, @@ -9258,16 +9441,24 @@ "description": "The content attributes for each content_type" }, "sender_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ - "contact", - "agent", - "agent_bot" + "Contact", + "User", + "AgentBot", + "Captain::Assistant", + null ], "description": "The type of the sender" }, "sender_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the sender" }, "external_source_ids": { @@ -9279,19 +9470,31 @@ "description": "The additional attributes of the message" }, "processed_message_content": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The processed message content" }, "sentiment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The sentiment of the message" }, "conversation": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The conversation object" }, "attachment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The file object attached to the image" }, "sender": { @@ -9322,12 +9525,16 @@ "type": "boolean" }, "display_name": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "message_signature": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "email": { "type": "string" @@ -9336,7 +9543,10 @@ "type": "string" }, "inviter_id": { - "type": "number" + "type": [ + "number", + "null" + ] }, "name": { "type": "string" @@ -9361,8 +9571,10 @@ "type": "string" }, "type": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "custom_attributes": { "type": "object", @@ -9383,7 +9595,10 @@ "type": "string" }, "active_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "role": { @@ -9409,12 +9624,16 @@ "type": "boolean" }, "custom_role_id": { - "type": "number", - "nullable": true + "type": [ + "number", + "null" + ] }, "custom_role": { - "type": "object", - "nullable": true + "type": [ + "object", + "null" + ] } } } @@ -9472,7 +9691,10 @@ "description": "The thumbnail of the agent" }, "custom_role_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "The custom role id of the agent" } } @@ -9517,11 +9739,17 @@ "description": "Script used to load the website widget" }, "welcome_title": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { @@ -9529,7 +9757,10 @@ "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "A greeting message when the user starts the conversation" }, "channel_id": { @@ -9553,7 +9784,10 @@ "description": "Configuration settings for auto assignment" }, "out_of_office_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Message to show when agents are out of office" }, "working_hours": { @@ -9571,19 +9805,31 @@ "description": "Whether the inbox is closed for the entire day" }, "open_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox opens (0-23)" }, "open_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox opens (0-59)" }, "close_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox closes (0-23)" }, "close_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox closes (0-59)" }, "open_all_day": { @@ -9598,7 +9844,10 @@ "description": "Timezone configuration for the inbox" }, "callback_webhook_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Webhook URL for callbacks" }, "allow_messages_after_resolved": { @@ -9614,7 +9863,10 @@ "description": "Type of sender name to display (e.g., friendly)" }, "business_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Business name associated with the inbox" }, "hmac_mandatory": { @@ -9622,19 +9874,31 @@ "description": "Whether HMAC verification is mandatory" }, "selected_feature_flags": { - "type": "object", - "description": "Selected feature flags for the inbox" + "type": [ + "array", + "null" + ], + "description": "Selected feature flags for the inbox", + "items": { + "type": "string" + } }, "reply_time": { "type": "string", "description": "Expected reply time" }, "messaging_service_sid": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Messaging service SID for SMS providers" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Phone number associated with the inbox" }, "medium": { @@ -9642,7 +9906,10 @@ "description": "Medium of communication (e.g., sms, email)" }, "provider": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Provider of the channel" } } @@ -9877,10 +10144,7 @@ "description": "Cache keys for the account" }, "features": { - "type": "array", - "items": { - "type": "string" - }, + "type": "object", "description": "Enabled features for the account" }, "settings": { @@ -9906,19 +10170,31 @@ "description": "Custom attributes of the account", "properties": { "plan_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription plan name" }, "subscribed_quantity": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Subscribed quantity" }, "subscription_status": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription status" }, "subscription_ends_on": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date", "description": "Subscription end date" }, @@ -9964,7 +10240,10 @@ "type": "object", "properties": { "latest_chatwoot_version": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Latest version of Chatwoot available", "example": "3.0.0" }, @@ -10025,7 +10304,10 @@ "description": "The name of the team" }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The description about the team" }, "allow_auto_assign": { @@ -10168,8 +10450,10 @@ "description": "Version number of the audit log entry" }, "comment": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Optional comment associated with the audit log entry" }, "request_uuid": { @@ -10181,8 +10465,10 @@ "description": "Unix timestamp when the audit log entry was created" }, "remote_address": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "IP address from which the action was performed" } } @@ -10418,22 +10704,28 @@ "example": "support@example.com" }, "auto_resolve_after": { - "type": "integer", + "type": [ + "integer", + "null" + ], "minimum": 10, "maximum": 1439856, - "nullable": true, "description": "Auto resolve conversations after specified minutes", "example": 1440 }, "auto_resolve_message": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Message to send when auto resolving", "example": "This conversation has been automatically resolved due to inactivity" }, "auto_resolve_ignore_waiting": { - "type": "boolean", - "nullable": true, + "type": [ + "boolean", + "null" + ], "description": "Whether to ignore waiting conversations for auto resolve", "example": false }, @@ -10837,8 +11129,7 @@ "conversation_create_payload": { "type": "object", "required": [ - "source_id", - "inbox_id" + "source_id" ], "properties": { "source_id": { @@ -11845,7 +12136,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -11857,7 +12151,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -11865,11 +12162,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -11976,7 +12279,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -11988,7 +12294,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -11996,11 +12305,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -12063,7 +12378,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -12075,7 +12393,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -12083,11 +12404,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -12468,18 +12795,24 @@ "description": "Number of conversations resolved in the inbox during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -12522,18 +12855,24 @@ "description": "Number of conversations resolved by the agent during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -12576,18 +12915,24 @@ "description": "Number of conversations resolved by the team during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -12627,7 +12972,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -12649,18 +12997,22 @@ "description": "The ID of the contact" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "thumbnail": { "type": "string", @@ -12712,10 +13064,18 @@ "type": "string", "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", "form", - "input_csat" + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call" ], "description": "The type of the message content" }, @@ -12734,16 +13094,20 @@ "description": "The content attributes for each content_type", "properties": { "in_reply_to": { - "type": "string", - "description": "ID of the message this is replying to", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "ID of the message this is replying to" } } }, "echo_id": { - "type": "string", - "description": "The echo ID of the message, used for deduplication", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The echo ID of the message, used for deduplication" }, "created_at": { "type": "integer", @@ -12754,9 +13118,11 @@ "description": "The flag which shows whether the message is private or not" }, "source_id": { - "type": "string", - "description": "The source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The source ID of the message" }, "sender": { "$ref": "#/components/schemas/contact_detail" @@ -12887,14 +13253,18 @@ "nullable": true }, "agent_last_seen_at": { - "type": "string", - "description": "Timestamp when the agent last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the agent last saw the conversation" }, "assignee_last_seen_at": { - "type": "string", - "description": "Timestamp when the assignee last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the assignee last saw the conversation" } } }, @@ -12921,7 +13291,10 @@ "description": "Total number of contacts" }, "current_page": { - "type": "string", + "type": [ + "string", + "integer" + ], "description": "Current page number" } } @@ -12957,9 +13330,11 @@ "description": "Type of channel" }, "provider": { - "type": "string", - "description": "Provider of the inbox", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Provider of the inbox" } } } @@ -12981,7 +13356,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -12999,9 +13377,11 @@ ] }, "email": { - "type": "string", - "description": "The email address of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The email address of the contact" }, "id": { "type": "integer", @@ -13012,18 +13392,22 @@ "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "blocked": { "type": "boolean", "description": "Whether the contact is blocked" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "thumbnail": { "type": "string", @@ -13034,9 +13418,11 @@ "description": "The custom attributes of the contact" }, "last_activity_at": { - "type": "integer", - "description": "Timestamp of last activity", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "Timestamp of last activity" }, "created_at": { "type": "integer", @@ -13118,9 +13504,11 @@ "description": "Status of the message" }, "source_id": { - "type": "string", - "description": "Source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Source ID of the message" }, "content_type": { "type": "string", @@ -13131,14 +13519,18 @@ "description": "Attributes of the content" }, "sender_type": { - "type": "string", - "description": "Type of the sender", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Type of the sender" }, "sender_id": { - "type": "integer", - "description": "ID of the sender", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the sender" }, "external_source_ids": { "type": "object", @@ -13149,9 +13541,11 @@ "description": "Additional attributes of the message" }, "processed_message_content": { - "type": "string", - "description": "Processed message content", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Processed message content" }, "sentiment": { "type": "object", @@ -13162,9 +13556,11 @@ "description": "Conversation details", "properties": { "assignee_id": { - "type": "integer", - "description": "ID of the assignee", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the assignee" }, "unread_count": { "type": "integer", @@ -13250,7 +13646,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -13262,7 +13661,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -13270,11 +13672,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -13360,18 +13768,24 @@ "description": "ID of the account" }, "conversation_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the conversation" }, "inbox_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the inbox" }, "user_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the user/agent" }, "created_at": { diff --git a/swagger/tag_groups/application.yml b/swagger/tag_groups/application.yml index 85d96c5b7..6e671d414 100644 --- a/swagger/tag_groups/application.yml +++ b/swagger/tag_groups/application.yml @@ -1,4 +1,4 @@ -openapi: '3.0.4' +openapi: '3.1.0' info: title: Chatwoot - Application API description: Application API endpoints for Chatwoot diff --git a/swagger/tag_groups/application_swagger.json b/swagger/tag_groups/application_swagger.json index ba482c9d7..7d8764ba3 100644 --- a/swagger/tag_groups/application_swagger.json +++ b/swagger/tag_groups/application_swagger.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.4", + "openapi": "3.1.0", "info": { "title": "Chatwoot", "description": "This is the API documentation for Chatwoot server.", @@ -19,7 +19,7 @@ } ], "paths": { - "/api/v1/accounts/{id}": { + "/api/v1/accounts/{account_id}": { "parameters": [ { "$ref": "#/components/parameters/account_id" @@ -3264,7 +3264,14 @@ }, "responses": { "200": { - "description": "Success" + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation" + } + } + } }, "401": { "description": "Unauthorized", @@ -3969,70 +3976,7 @@ } } } - } - }, - "/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" @@ -4095,6 +4039,65 @@ } }, "/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" + } + } + } + } + } + }, "patch": { "tags": [ "Inboxes" @@ -4707,11 +4710,17 @@ "$ref": "#/components/schemas/agent" }, "agent_last_seen_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "assignee_last_seen_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" } } @@ -5116,6 +5125,127 @@ } } } + }, + "put": { + "tags": [ + "Profile" + ], + "operationId": "updateProfile", + "summary": "Update user profile", + "description": "Update the user profile details", + "security": [ + { + "userApiKey": [] + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "profile" + ], + "properties": { + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "message_signature": { + "type": "string" + }, + "phone_number": { + "type": "string" + }, + "current_password": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_confirmation": { + "type": "string" + }, + "ui_settings": { + "type": "object" + } + } + } + } + } + }, + "multipart/form-data": { + "schema": { + "type": "object", + "required": [ + "profile" + ], + "properties": { + "profile": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "message_signature": { + "type": "string" + }, + "phone_number": { + "type": "string" + }, + "current_password": { + "type": "string" + }, + "password": { + "type": "string" + }, + "password_confirmation": { + "type": "string" + }, + "avatar": { + "type": "string", + "format": "binary" + }, + "ui_settings": { + "type": "object" + } + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } + } + }, + "401": { + "description": "Unauthorized" + } + } } }, "/api/v1/accounts/{account_id}/teams": { @@ -7323,18 +7453,24 @@ "description": "Total number of articles" }, "archived_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of archived articles" }, "published_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of published articles" }, "draft_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of draft articles" }, "categories_count": { @@ -7628,7 +7764,10 @@ "description": "Whether the conversation is muted" }, "snoozed_until": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation will be unmuted" }, "status": { @@ -7649,11 +7788,14 @@ "description": "The time at which conversation was updated" }, "timestamp": { - "type": "string", + "type": "number", "description": "The time at which conversation was created" }, "first_reply_created_at": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the first reply was created" }, "unread_count": { @@ -7661,22 +7803,39 @@ "description": "The number of unread messages" }, "last_non_activity_message": { - "$ref": "#/components/schemas/message" + "oneOf": [ + { + "$ref": "#/components/schemas/message" + }, + { + "type": "null" + } + ], + "description": "The last non activity message" }, "last_activity_at": { "type": "number", "description": "The last activity at of the conversation" }, "priority": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The priority of the conversation" }, "waiting_since": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation was waiting" }, "sla_policy_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the SLA policy" }, "applied_sla": { @@ -7720,7 +7879,8 @@ "enum": [ 0, 1, - 2 + 2, + 3 ], "description": "The type of the message" }, @@ -7729,7 +7889,10 @@ "description": "The time at which message was created" }, "updated_at": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "The time at which message was updated" }, "private": { @@ -7737,26 +7900,46 @@ "description": "The flags which shows whether the message is private or not" }, "status": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "sent", "delivered", "read", - "failed" + "failed", + null ], "description": "The status of the message" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The source ID of the message" }, "content_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", - "form" + "form", + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call", + null ], "description": "The type of the template message" }, @@ -7765,16 +7948,24 @@ "description": "The content attributes for each content_type" }, "sender_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ - "contact", - "agent", - "agent_bot" + "Contact", + "User", + "AgentBot", + "Captain::Assistant", + null ], "description": "The type of the sender" }, "sender_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the sender" }, "external_source_ids": { @@ -7786,19 +7977,31 @@ "description": "The additional attributes of the message" }, "processed_message_content": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The processed message content" }, "sentiment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The sentiment of the message" }, "conversation": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The conversation object" }, "attachment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The file object attached to the image" }, "sender": { @@ -7829,12 +8032,16 @@ "type": "boolean" }, "display_name": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "message_signature": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "email": { "type": "string" @@ -7843,7 +8050,10 @@ "type": "string" }, "inviter_id": { - "type": "number" + "type": [ + "number", + "null" + ] }, "name": { "type": "string" @@ -7868,8 +8078,10 @@ "type": "string" }, "type": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "custom_attributes": { "type": "object", @@ -7890,7 +8102,10 @@ "type": "string" }, "active_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "role": { @@ -7916,12 +8131,16 @@ "type": "boolean" }, "custom_role_id": { - "type": "number", - "nullable": true + "type": [ + "number", + "null" + ] }, "custom_role": { - "type": "object", - "nullable": true + "type": [ + "object", + "null" + ] } } } @@ -7979,7 +8198,10 @@ "description": "The thumbnail of the agent" }, "custom_role_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "The custom role id of the agent" } } @@ -8024,11 +8246,17 @@ "description": "Script used to load the website widget" }, "welcome_title": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { @@ -8036,7 +8264,10 @@ "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "A greeting message when the user starts the conversation" }, "channel_id": { @@ -8060,7 +8291,10 @@ "description": "Configuration settings for auto assignment" }, "out_of_office_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Message to show when agents are out of office" }, "working_hours": { @@ -8078,19 +8312,31 @@ "description": "Whether the inbox is closed for the entire day" }, "open_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox opens (0-23)" }, "open_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox opens (0-59)" }, "close_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox closes (0-23)" }, "close_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox closes (0-59)" }, "open_all_day": { @@ -8105,7 +8351,10 @@ "description": "Timezone configuration for the inbox" }, "callback_webhook_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Webhook URL for callbacks" }, "allow_messages_after_resolved": { @@ -8121,7 +8370,10 @@ "description": "Type of sender name to display (e.g., friendly)" }, "business_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Business name associated with the inbox" }, "hmac_mandatory": { @@ -8129,19 +8381,31 @@ "description": "Whether HMAC verification is mandatory" }, "selected_feature_flags": { - "type": "object", - "description": "Selected feature flags for the inbox" + "type": [ + "array", + "null" + ], + "description": "Selected feature flags for the inbox", + "items": { + "type": "string" + } }, "reply_time": { "type": "string", "description": "Expected reply time" }, "messaging_service_sid": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Messaging service SID for SMS providers" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Phone number associated with the inbox" }, "medium": { @@ -8149,7 +8413,10 @@ "description": "Medium of communication (e.g., sms, email)" }, "provider": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Provider of the channel" } } @@ -8384,10 +8651,7 @@ "description": "Cache keys for the account" }, "features": { - "type": "array", - "items": { - "type": "string" - }, + "type": "object", "description": "Enabled features for the account" }, "settings": { @@ -8413,19 +8677,31 @@ "description": "Custom attributes of the account", "properties": { "plan_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription plan name" }, "subscribed_quantity": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Subscribed quantity" }, "subscription_status": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription status" }, "subscription_ends_on": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date", "description": "Subscription end date" }, @@ -8471,7 +8747,10 @@ "type": "object", "properties": { "latest_chatwoot_version": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Latest version of Chatwoot available", "example": "3.0.0" }, @@ -8532,7 +8811,10 @@ "description": "The name of the team" }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The description about the team" }, "allow_auto_assign": { @@ -8675,8 +8957,10 @@ "description": "Version number of the audit log entry" }, "comment": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Optional comment associated with the audit log entry" }, "request_uuid": { @@ -8688,8 +8972,10 @@ "description": "Unix timestamp when the audit log entry was created" }, "remote_address": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "IP address from which the action was performed" } } @@ -8925,22 +9211,28 @@ "example": "support@example.com" }, "auto_resolve_after": { - "type": "integer", + "type": [ + "integer", + "null" + ], "minimum": 10, "maximum": 1439856, - "nullable": true, "description": "Auto resolve conversations after specified minutes", "example": 1440 }, "auto_resolve_message": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Message to send when auto resolving", "example": "This conversation has been automatically resolved due to inactivity" }, "auto_resolve_ignore_waiting": { - "type": "boolean", - "nullable": true, + "type": [ + "boolean", + "null" + ], "description": "Whether to ignore waiting conversations for auto resolve", "example": false }, @@ -9344,8 +9636,7 @@ "conversation_create_payload": { "type": "object", "required": [ - "source_id", - "inbox_id" + "source_id" ], "properties": { "source_id": { @@ -10352,7 +10643,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -10364,7 +10658,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -10372,11 +10669,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -10483,7 +10786,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -10495,7 +10801,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -10503,11 +10812,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -10570,7 +10885,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -10582,7 +10900,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -10590,11 +10911,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -10975,18 +11302,24 @@ "description": "Number of conversations resolved in the inbox during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -11029,18 +11362,24 @@ "description": "Number of conversations resolved by the agent during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -11083,18 +11422,24 @@ "description": "Number of conversations resolved by the team during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -11134,7 +11479,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -11156,18 +11504,22 @@ "description": "The ID of the contact" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "thumbnail": { "type": "string", @@ -11219,10 +11571,18 @@ "type": "string", "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", "form", - "input_csat" + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call" ], "description": "The type of the message content" }, @@ -11241,16 +11601,20 @@ "description": "The content attributes for each content_type", "properties": { "in_reply_to": { - "type": "string", - "description": "ID of the message this is replying to", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "ID of the message this is replying to" } } }, "echo_id": { - "type": "string", - "description": "The echo ID of the message, used for deduplication", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The echo ID of the message, used for deduplication" }, "created_at": { "type": "integer", @@ -11261,9 +11625,11 @@ "description": "The flag which shows whether the message is private or not" }, "source_id": { - "type": "string", - "description": "The source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The source ID of the message" }, "sender": { "$ref": "#/components/schemas/contact_detail" @@ -11394,14 +11760,18 @@ "nullable": true }, "agent_last_seen_at": { - "type": "string", - "description": "Timestamp when the agent last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the agent last saw the conversation" }, "assignee_last_seen_at": { - "type": "string", - "description": "Timestamp when the assignee last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the assignee last saw the conversation" } } }, @@ -11428,7 +11798,10 @@ "description": "Total number of contacts" }, "current_page": { - "type": "string", + "type": [ + "string", + "integer" + ], "description": "Current page number" } } @@ -11464,9 +11837,11 @@ "description": "Type of channel" }, "provider": { - "type": "string", - "description": "Provider of the inbox", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Provider of the inbox" } } } @@ -11488,7 +11863,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -11506,9 +11884,11 @@ ] }, "email": { - "type": "string", - "description": "The email address of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The email address of the contact" }, "id": { "type": "integer", @@ -11519,18 +11899,22 @@ "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "blocked": { "type": "boolean", "description": "Whether the contact is blocked" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "thumbnail": { "type": "string", @@ -11541,9 +11925,11 @@ "description": "The custom attributes of the contact" }, "last_activity_at": { - "type": "integer", - "description": "Timestamp of last activity", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "Timestamp of last activity" }, "created_at": { "type": "integer", @@ -11625,9 +12011,11 @@ "description": "Status of the message" }, "source_id": { - "type": "string", - "description": "Source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Source ID of the message" }, "content_type": { "type": "string", @@ -11638,14 +12026,18 @@ "description": "Attributes of the content" }, "sender_type": { - "type": "string", - "description": "Type of the sender", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Type of the sender" }, "sender_id": { - "type": "integer", - "description": "ID of the sender", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the sender" }, "external_source_ids": { "type": "object", @@ -11656,9 +12048,11 @@ "description": "Additional attributes of the message" }, "processed_message_content": { - "type": "string", - "description": "Processed message content", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Processed message content" }, "sentiment": { "type": "object", @@ -11669,9 +12063,11 @@ "description": "Conversation details", "properties": { "assignee_id": { - "type": "integer", - "description": "ID of the assignee", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the assignee" }, "unread_count": { "type": "integer", @@ -11757,7 +12153,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -11769,7 +12168,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -11777,11 +12179,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -11867,18 +12275,24 @@ "description": "ID of the account" }, "conversation_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the conversation" }, "inbox_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the inbox" }, "user_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the user/agent" }, "created_at": { diff --git a/swagger/tag_groups/client.yml b/swagger/tag_groups/client.yml index fdd177b97..098ff654e 100644 --- a/swagger/tag_groups/client.yml +++ b/swagger/tag_groups/client.yml @@ -1,4 +1,4 @@ -openapi: '3.0.4' +openapi: '3.1.0' info: title: Chatwoot - Client API description: Client API endpoints for Chatwoot diff --git a/swagger/tag_groups/client_swagger.json b/swagger/tag_groups/client_swagger.json index ac6915726..fe0e07742 100644 --- a/swagger/tag_groups/client_swagger.json +++ b/swagger/tag_groups/client_swagger.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.4", + "openapi": "3.1.0", "info": { "title": "Chatwoot", "description": "This is the API documentation for Chatwoot server.", @@ -958,18 +958,24 @@ "description": "Total number of articles" }, "archived_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of archived articles" }, "published_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of published articles" }, "draft_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of draft articles" }, "categories_count": { @@ -1263,7 +1269,10 @@ "description": "Whether the conversation is muted" }, "snoozed_until": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation will be unmuted" }, "status": { @@ -1284,11 +1293,14 @@ "description": "The time at which conversation was updated" }, "timestamp": { - "type": "string", + "type": "number", "description": "The time at which conversation was created" }, "first_reply_created_at": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the first reply was created" }, "unread_count": { @@ -1296,22 +1308,39 @@ "description": "The number of unread messages" }, "last_non_activity_message": { - "$ref": "#/components/schemas/message" + "oneOf": [ + { + "$ref": "#/components/schemas/message" + }, + { + "type": "null" + } + ], + "description": "The last non activity message" }, "last_activity_at": { "type": "number", "description": "The last activity at of the conversation" }, "priority": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The priority of the conversation" }, "waiting_since": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation was waiting" }, "sla_policy_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the SLA policy" }, "applied_sla": { @@ -1355,7 +1384,8 @@ "enum": [ 0, 1, - 2 + 2, + 3 ], "description": "The type of the message" }, @@ -1364,7 +1394,10 @@ "description": "The time at which message was created" }, "updated_at": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "The time at which message was updated" }, "private": { @@ -1372,26 +1405,46 @@ "description": "The flags which shows whether the message is private or not" }, "status": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "sent", "delivered", "read", - "failed" + "failed", + null ], "description": "The status of the message" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The source ID of the message" }, "content_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", - "form" + "form", + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call", + null ], "description": "The type of the template message" }, @@ -1400,16 +1453,24 @@ "description": "The content attributes for each content_type" }, "sender_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ - "contact", - "agent", - "agent_bot" + "Contact", + "User", + "AgentBot", + "Captain::Assistant", + null ], "description": "The type of the sender" }, "sender_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the sender" }, "external_source_ids": { @@ -1421,19 +1482,31 @@ "description": "The additional attributes of the message" }, "processed_message_content": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The processed message content" }, "sentiment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The sentiment of the message" }, "conversation": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The conversation object" }, "attachment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The file object attached to the image" }, "sender": { @@ -1464,12 +1537,16 @@ "type": "boolean" }, "display_name": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "message_signature": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "email": { "type": "string" @@ -1478,7 +1555,10 @@ "type": "string" }, "inviter_id": { - "type": "number" + "type": [ + "number", + "null" + ] }, "name": { "type": "string" @@ -1503,8 +1583,10 @@ "type": "string" }, "type": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "custom_attributes": { "type": "object", @@ -1525,7 +1607,10 @@ "type": "string" }, "active_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "role": { @@ -1551,12 +1636,16 @@ "type": "boolean" }, "custom_role_id": { - "type": "number", - "nullable": true + "type": [ + "number", + "null" + ] }, "custom_role": { - "type": "object", - "nullable": true + "type": [ + "object", + "null" + ] } } } @@ -1614,7 +1703,10 @@ "description": "The thumbnail of the agent" }, "custom_role_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "The custom role id of the agent" } } @@ -1659,11 +1751,17 @@ "description": "Script used to load the website widget" }, "welcome_title": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { @@ -1671,7 +1769,10 @@ "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "A greeting message when the user starts the conversation" }, "channel_id": { @@ -1695,7 +1796,10 @@ "description": "Configuration settings for auto assignment" }, "out_of_office_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Message to show when agents are out of office" }, "working_hours": { @@ -1713,19 +1817,31 @@ "description": "Whether the inbox is closed for the entire day" }, "open_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox opens (0-23)" }, "open_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox opens (0-59)" }, "close_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox closes (0-23)" }, "close_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox closes (0-59)" }, "open_all_day": { @@ -1740,7 +1856,10 @@ "description": "Timezone configuration for the inbox" }, "callback_webhook_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Webhook URL for callbacks" }, "allow_messages_after_resolved": { @@ -1756,7 +1875,10 @@ "description": "Type of sender name to display (e.g., friendly)" }, "business_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Business name associated with the inbox" }, "hmac_mandatory": { @@ -1764,19 +1886,31 @@ "description": "Whether HMAC verification is mandatory" }, "selected_feature_flags": { - "type": "object", - "description": "Selected feature flags for the inbox" + "type": [ + "array", + "null" + ], + "description": "Selected feature flags for the inbox", + "items": { + "type": "string" + } }, "reply_time": { "type": "string", "description": "Expected reply time" }, "messaging_service_sid": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Messaging service SID for SMS providers" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Phone number associated with the inbox" }, "medium": { @@ -1784,7 +1918,10 @@ "description": "Medium of communication (e.g., sms, email)" }, "provider": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Provider of the channel" } } @@ -2019,10 +2156,7 @@ "description": "Cache keys for the account" }, "features": { - "type": "array", - "items": { - "type": "string" - }, + "type": "object", "description": "Enabled features for the account" }, "settings": { @@ -2048,19 +2182,31 @@ "description": "Custom attributes of the account", "properties": { "plan_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription plan name" }, "subscribed_quantity": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Subscribed quantity" }, "subscription_status": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription status" }, "subscription_ends_on": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date", "description": "Subscription end date" }, @@ -2106,7 +2252,10 @@ "type": "object", "properties": { "latest_chatwoot_version": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Latest version of Chatwoot available", "example": "3.0.0" }, @@ -2167,7 +2316,10 @@ "description": "The name of the team" }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The description about the team" }, "allow_auto_assign": { @@ -2310,8 +2462,10 @@ "description": "Version number of the audit log entry" }, "comment": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Optional comment associated with the audit log entry" }, "request_uuid": { @@ -2323,8 +2477,10 @@ "description": "Unix timestamp when the audit log entry was created" }, "remote_address": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "IP address from which the action was performed" } } @@ -2560,22 +2716,28 @@ "example": "support@example.com" }, "auto_resolve_after": { - "type": "integer", + "type": [ + "integer", + "null" + ], "minimum": 10, "maximum": 1439856, - "nullable": true, "description": "Auto resolve conversations after specified minutes", "example": 1440 }, "auto_resolve_message": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Message to send when auto resolving", "example": "This conversation has been automatically resolved due to inactivity" }, "auto_resolve_ignore_waiting": { - "type": "boolean", - "nullable": true, + "type": [ + "boolean", + "null" + ], "description": "Whether to ignore waiting conversations for auto resolve", "example": false }, @@ -2979,8 +3141,7 @@ "conversation_create_payload": { "type": "object", "required": [ - "source_id", - "inbox_id" + "source_id" ], "properties": { "source_id": { @@ -3987,7 +4148,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -3999,7 +4163,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4007,11 +4174,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4118,7 +4291,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4130,7 +4306,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4138,11 +4317,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4205,7 +4390,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4217,7 +4405,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4225,11 +4416,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4610,18 +4807,24 @@ "description": "Number of conversations resolved in the inbox during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4664,18 +4867,24 @@ "description": "Number of conversations resolved by the agent during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4718,18 +4927,24 @@ "description": "Number of conversations resolved by the team during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4769,7 +4984,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -4791,18 +5009,22 @@ "description": "The ID of the contact" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "thumbnail": { "type": "string", @@ -4854,10 +5076,18 @@ "type": "string", "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", "form", - "input_csat" + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call" ], "description": "The type of the message content" }, @@ -4876,16 +5106,20 @@ "description": "The content attributes for each content_type", "properties": { "in_reply_to": { - "type": "string", - "description": "ID of the message this is replying to", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "ID of the message this is replying to" } } }, "echo_id": { - "type": "string", - "description": "The echo ID of the message, used for deduplication", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The echo ID of the message, used for deduplication" }, "created_at": { "type": "integer", @@ -4896,9 +5130,11 @@ "description": "The flag which shows whether the message is private or not" }, "source_id": { - "type": "string", - "description": "The source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The source ID of the message" }, "sender": { "$ref": "#/components/schemas/contact_detail" @@ -5029,14 +5265,18 @@ "nullable": true }, "agent_last_seen_at": { - "type": "string", - "description": "Timestamp when the agent last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the agent last saw the conversation" }, "assignee_last_seen_at": { - "type": "string", - "description": "Timestamp when the assignee last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the assignee last saw the conversation" } } }, @@ -5063,7 +5303,10 @@ "description": "Total number of contacts" }, "current_page": { - "type": "string", + "type": [ + "string", + "integer" + ], "description": "Current page number" } } @@ -5099,9 +5342,11 @@ "description": "Type of channel" }, "provider": { - "type": "string", - "description": "Provider of the inbox", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Provider of the inbox" } } } @@ -5123,7 +5368,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -5141,9 +5389,11 @@ ] }, "email": { - "type": "string", - "description": "The email address of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The email address of the contact" }, "id": { "type": "integer", @@ -5154,18 +5404,22 @@ "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "blocked": { "type": "boolean", "description": "Whether the contact is blocked" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "thumbnail": { "type": "string", @@ -5176,9 +5430,11 @@ "description": "The custom attributes of the contact" }, "last_activity_at": { - "type": "integer", - "description": "Timestamp of last activity", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "Timestamp of last activity" }, "created_at": { "type": "integer", @@ -5260,9 +5516,11 @@ "description": "Status of the message" }, "source_id": { - "type": "string", - "description": "Source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Source ID of the message" }, "content_type": { "type": "string", @@ -5273,14 +5531,18 @@ "description": "Attributes of the content" }, "sender_type": { - "type": "string", - "description": "Type of the sender", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Type of the sender" }, "sender_id": { - "type": "integer", - "description": "ID of the sender", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the sender" }, "external_source_ids": { "type": "object", @@ -5291,9 +5553,11 @@ "description": "Additional attributes of the message" }, "processed_message_content": { - "type": "string", - "description": "Processed message content", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Processed message content" }, "sentiment": { "type": "object", @@ -5304,9 +5568,11 @@ "description": "Conversation details", "properties": { "assignee_id": { - "type": "integer", - "description": "ID of the assignee", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the assignee" }, "unread_count": { "type": "integer", @@ -5392,7 +5658,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -5404,7 +5673,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -5412,11 +5684,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -5502,18 +5780,24 @@ "description": "ID of the account" }, "conversation_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the conversation" }, "inbox_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the inbox" }, "user_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the user/agent" }, "created_at": { diff --git a/swagger/tag_groups/other_swagger.json b/swagger/tag_groups/other_swagger.json index 9fb01fa98..526a51865 100644 --- a/swagger/tag_groups/other_swagger.json +++ b/swagger/tag_groups/other_swagger.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.4", + "openapi": "3.1.0", "info": { "title": "Chatwoot", "description": "This is the API documentation for Chatwoot server.", @@ -373,18 +373,24 @@ "description": "Total number of articles" }, "archived_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of archived articles" }, "published_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of published articles" }, "draft_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of draft articles" }, "categories_count": { @@ -678,7 +684,10 @@ "description": "Whether the conversation is muted" }, "snoozed_until": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation will be unmuted" }, "status": { @@ -699,11 +708,14 @@ "description": "The time at which conversation was updated" }, "timestamp": { - "type": "string", + "type": "number", "description": "The time at which conversation was created" }, "first_reply_created_at": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the first reply was created" }, "unread_count": { @@ -711,22 +723,39 @@ "description": "The number of unread messages" }, "last_non_activity_message": { - "$ref": "#/components/schemas/message" + "oneOf": [ + { + "$ref": "#/components/schemas/message" + }, + { + "type": "null" + } + ], + "description": "The last non activity message" }, "last_activity_at": { "type": "number", "description": "The last activity at of the conversation" }, "priority": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The priority of the conversation" }, "waiting_since": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation was waiting" }, "sla_policy_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the SLA policy" }, "applied_sla": { @@ -770,7 +799,8 @@ "enum": [ 0, 1, - 2 + 2, + 3 ], "description": "The type of the message" }, @@ -779,7 +809,10 @@ "description": "The time at which message was created" }, "updated_at": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "The time at which message was updated" }, "private": { @@ -787,26 +820,46 @@ "description": "The flags which shows whether the message is private or not" }, "status": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "sent", "delivered", "read", - "failed" + "failed", + null ], "description": "The status of the message" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The source ID of the message" }, "content_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", - "form" + "form", + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call", + null ], "description": "The type of the template message" }, @@ -815,16 +868,24 @@ "description": "The content attributes for each content_type" }, "sender_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ - "contact", - "agent", - "agent_bot" + "Contact", + "User", + "AgentBot", + "Captain::Assistant", + null ], "description": "The type of the sender" }, "sender_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the sender" }, "external_source_ids": { @@ -836,19 +897,31 @@ "description": "The additional attributes of the message" }, "processed_message_content": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The processed message content" }, "sentiment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The sentiment of the message" }, "conversation": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The conversation object" }, "attachment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The file object attached to the image" }, "sender": { @@ -879,12 +952,16 @@ "type": "boolean" }, "display_name": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "message_signature": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "email": { "type": "string" @@ -893,7 +970,10 @@ "type": "string" }, "inviter_id": { - "type": "number" + "type": [ + "number", + "null" + ] }, "name": { "type": "string" @@ -918,8 +998,10 @@ "type": "string" }, "type": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "custom_attributes": { "type": "object", @@ -940,7 +1022,10 @@ "type": "string" }, "active_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "role": { @@ -966,12 +1051,16 @@ "type": "boolean" }, "custom_role_id": { - "type": "number", - "nullable": true + "type": [ + "number", + "null" + ] }, "custom_role": { - "type": "object", - "nullable": true + "type": [ + "object", + "null" + ] } } } @@ -1029,7 +1118,10 @@ "description": "The thumbnail of the agent" }, "custom_role_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "The custom role id of the agent" } } @@ -1074,11 +1166,17 @@ "description": "Script used to load the website widget" }, "welcome_title": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { @@ -1086,7 +1184,10 @@ "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "A greeting message when the user starts the conversation" }, "channel_id": { @@ -1110,7 +1211,10 @@ "description": "Configuration settings for auto assignment" }, "out_of_office_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Message to show when agents are out of office" }, "working_hours": { @@ -1128,19 +1232,31 @@ "description": "Whether the inbox is closed for the entire day" }, "open_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox opens (0-23)" }, "open_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox opens (0-59)" }, "close_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox closes (0-23)" }, "close_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox closes (0-59)" }, "open_all_day": { @@ -1155,7 +1271,10 @@ "description": "Timezone configuration for the inbox" }, "callback_webhook_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Webhook URL for callbacks" }, "allow_messages_after_resolved": { @@ -1171,7 +1290,10 @@ "description": "Type of sender name to display (e.g., friendly)" }, "business_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Business name associated with the inbox" }, "hmac_mandatory": { @@ -1179,19 +1301,31 @@ "description": "Whether HMAC verification is mandatory" }, "selected_feature_flags": { - "type": "object", - "description": "Selected feature flags for the inbox" + "type": [ + "array", + "null" + ], + "description": "Selected feature flags for the inbox", + "items": { + "type": "string" + } }, "reply_time": { "type": "string", "description": "Expected reply time" }, "messaging_service_sid": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Messaging service SID for SMS providers" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Phone number associated with the inbox" }, "medium": { @@ -1199,7 +1333,10 @@ "description": "Medium of communication (e.g., sms, email)" }, "provider": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Provider of the channel" } } @@ -1434,10 +1571,7 @@ "description": "Cache keys for the account" }, "features": { - "type": "array", - "items": { - "type": "string" - }, + "type": "object", "description": "Enabled features for the account" }, "settings": { @@ -1463,19 +1597,31 @@ "description": "Custom attributes of the account", "properties": { "plan_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription plan name" }, "subscribed_quantity": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Subscribed quantity" }, "subscription_status": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription status" }, "subscription_ends_on": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date", "description": "Subscription end date" }, @@ -1521,7 +1667,10 @@ "type": "object", "properties": { "latest_chatwoot_version": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Latest version of Chatwoot available", "example": "3.0.0" }, @@ -1582,7 +1731,10 @@ "description": "The name of the team" }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The description about the team" }, "allow_auto_assign": { @@ -1725,8 +1877,10 @@ "description": "Version number of the audit log entry" }, "comment": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Optional comment associated with the audit log entry" }, "request_uuid": { @@ -1738,8 +1892,10 @@ "description": "Unix timestamp when the audit log entry was created" }, "remote_address": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "IP address from which the action was performed" } } @@ -1975,22 +2131,28 @@ "example": "support@example.com" }, "auto_resolve_after": { - "type": "integer", + "type": [ + "integer", + "null" + ], "minimum": 10, "maximum": 1439856, - "nullable": true, "description": "Auto resolve conversations after specified minutes", "example": 1440 }, "auto_resolve_message": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Message to send when auto resolving", "example": "This conversation has been automatically resolved due to inactivity" }, "auto_resolve_ignore_waiting": { - "type": "boolean", - "nullable": true, + "type": [ + "boolean", + "null" + ], "description": "Whether to ignore waiting conversations for auto resolve", "example": false }, @@ -2394,8 +2556,7 @@ "conversation_create_payload": { "type": "object", "required": [ - "source_id", - "inbox_id" + "source_id" ], "properties": { "source_id": { @@ -3402,7 +3563,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -3414,7 +3578,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -3422,11 +3589,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -3533,7 +3706,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -3545,7 +3721,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -3553,11 +3732,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -3620,7 +3805,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -3632,7 +3820,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -3640,11 +3831,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4025,18 +4222,24 @@ "description": "Number of conversations resolved in the inbox during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4079,18 +4282,24 @@ "description": "Number of conversations resolved by the agent during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4133,18 +4342,24 @@ "description": "Number of conversations resolved by the team during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4184,7 +4399,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -4206,18 +4424,22 @@ "description": "The ID of the contact" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "thumbnail": { "type": "string", @@ -4269,10 +4491,18 @@ "type": "string", "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", "form", - "input_csat" + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call" ], "description": "The type of the message content" }, @@ -4291,16 +4521,20 @@ "description": "The content attributes for each content_type", "properties": { "in_reply_to": { - "type": "string", - "description": "ID of the message this is replying to", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "ID of the message this is replying to" } } }, "echo_id": { - "type": "string", - "description": "The echo ID of the message, used for deduplication", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The echo ID of the message, used for deduplication" }, "created_at": { "type": "integer", @@ -4311,9 +4545,11 @@ "description": "The flag which shows whether the message is private or not" }, "source_id": { - "type": "string", - "description": "The source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The source ID of the message" }, "sender": { "$ref": "#/components/schemas/contact_detail" @@ -4444,14 +4680,18 @@ "nullable": true }, "agent_last_seen_at": { - "type": "string", - "description": "Timestamp when the agent last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the agent last saw the conversation" }, "assignee_last_seen_at": { - "type": "string", - "description": "Timestamp when the assignee last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the assignee last saw the conversation" } } }, @@ -4478,7 +4718,10 @@ "description": "Total number of contacts" }, "current_page": { - "type": "string", + "type": [ + "string", + "integer" + ], "description": "Current page number" } } @@ -4514,9 +4757,11 @@ "description": "Type of channel" }, "provider": { - "type": "string", - "description": "Provider of the inbox", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Provider of the inbox" } } } @@ -4538,7 +4783,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -4556,9 +4804,11 @@ ] }, "email": { - "type": "string", - "description": "The email address of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The email address of the contact" }, "id": { "type": "integer", @@ -4569,18 +4819,22 @@ "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "blocked": { "type": "boolean", "description": "Whether the contact is blocked" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "thumbnail": { "type": "string", @@ -4591,9 +4845,11 @@ "description": "The custom attributes of the contact" }, "last_activity_at": { - "type": "integer", - "description": "Timestamp of last activity", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "Timestamp of last activity" }, "created_at": { "type": "integer", @@ -4675,9 +4931,11 @@ "description": "Status of the message" }, "source_id": { - "type": "string", - "description": "Source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Source ID of the message" }, "content_type": { "type": "string", @@ -4688,14 +4946,18 @@ "description": "Attributes of the content" }, "sender_type": { - "type": "string", - "description": "Type of the sender", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Type of the sender" }, "sender_id": { - "type": "integer", - "description": "ID of the sender", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the sender" }, "external_source_ids": { "type": "object", @@ -4706,9 +4968,11 @@ "description": "Additional attributes of the message" }, "processed_message_content": { - "type": "string", - "description": "Processed message content", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Processed message content" }, "sentiment": { "type": "object", @@ -4719,9 +4983,11 @@ "description": "Conversation details", "properties": { "assignee_id": { - "type": "integer", - "description": "ID of the assignee", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the assignee" }, "unread_count": { "type": "integer", @@ -4807,7 +5073,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4819,7 +5088,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4827,11 +5099,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4917,18 +5195,24 @@ "description": "ID of the account" }, "conversation_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the conversation" }, "inbox_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the inbox" }, "user_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the user/agent" }, "created_at": { diff --git a/swagger/tag_groups/others.yml b/swagger/tag_groups/others.yml index 08219959c..682f7ca18 100644 --- a/swagger/tag_groups/others.yml +++ b/swagger/tag_groups/others.yml @@ -1,4 +1,4 @@ -openapi: '3.0.4' +openapi: '3.1.0' info: title: Chatwoot - Other APIs description: Other API endpoints for Chatwoot diff --git a/swagger/tag_groups/platform.yml b/swagger/tag_groups/platform.yml index 139dd741e..f465f244f 100644 --- a/swagger/tag_groups/platform.yml +++ b/swagger/tag_groups/platform.yml @@ -1,4 +1,4 @@ -openapi: '3.0.4' +openapi: '3.1.0' info: title: Chatwoot - Platform API description: Platform API endpoints for Chatwoot diff --git a/swagger/tag_groups/platform_swagger.json b/swagger/tag_groups/platform_swagger.json index ee6452319..4535b3926 100644 --- a/swagger/tag_groups/platform_swagger.json +++ b/swagger/tag_groups/platform_swagger.json @@ -1,5 +1,5 @@ { - "openapi": "3.0.4", + "openapi": "3.1.0", "info": { "title": "Chatwoot", "description": "This is the API documentation for Chatwoot server.", @@ -1134,18 +1134,24 @@ "description": "Total number of articles" }, "archived_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of archived articles" }, "published_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of published articles" }, "draft_articles_count": { - "type": "integer", - "nullable": true, + "type": [ + "integer", + "null" + ], "description": "Number of draft articles" }, "categories_count": { @@ -1439,7 +1445,10 @@ "description": "Whether the conversation is muted" }, "snoozed_until": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation will be unmuted" }, "status": { @@ -1460,11 +1469,14 @@ "description": "The time at which conversation was updated" }, "timestamp": { - "type": "string", + "type": "number", "description": "The time at which conversation was created" }, "first_reply_created_at": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the first reply was created" }, "unread_count": { @@ -1472,22 +1484,39 @@ "description": "The number of unread messages" }, "last_non_activity_message": { - "$ref": "#/components/schemas/message" + "oneOf": [ + { + "$ref": "#/components/schemas/message" + }, + { + "type": "null" + } + ], + "description": "The last non activity message" }, "last_activity_at": { "type": "number", "description": "The last activity at of the conversation" }, "priority": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The priority of the conversation" }, "waiting_since": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The time at which the conversation was waiting" }, "sla_policy_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the SLA policy" }, "applied_sla": { @@ -1531,7 +1560,8 @@ "enum": [ 0, 1, - 2 + 2, + 3 ], "description": "The type of the message" }, @@ -1540,7 +1570,10 @@ "description": "The time at which message was created" }, "updated_at": { - "type": "integer", + "type": [ + "integer", + "string" + ], "description": "The time at which message was updated" }, "private": { @@ -1548,26 +1581,46 @@ "description": "The flags which shows whether the message is private or not" }, "status": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "sent", "delivered", "read", - "failed" + "failed", + null ], "description": "The status of the message" }, "source_id": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The source ID of the message" }, "content_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", - "form" + "form", + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call", + null ], "description": "The type of the template message" }, @@ -1576,16 +1629,24 @@ "description": "The content attributes for each content_type" }, "sender_type": { - "type": "string", + "type": [ + "string", + "null" + ], "enum": [ - "contact", - "agent", - "agent_bot" + "Contact", + "User", + "AgentBot", + "Captain::Assistant", + null ], "description": "The type of the sender" }, "sender_id": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "The ID of the sender" }, "external_source_ids": { @@ -1597,19 +1658,31 @@ "description": "The additional attributes of the message" }, "processed_message_content": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The processed message content" }, "sentiment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The sentiment of the message" }, "conversation": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The conversation object" }, "attachment": { - "type": "object", + "type": [ + "object", + "null" + ], "description": "The file object attached to the image" }, "sender": { @@ -1640,12 +1713,16 @@ "type": "boolean" }, "display_name": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "message_signature": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "email": { "type": "string" @@ -1654,7 +1731,10 @@ "type": "string" }, "inviter_id": { - "type": "number" + "type": [ + "number", + "null" + ] }, "name": { "type": "string" @@ -1679,8 +1759,10 @@ "type": "string" }, "type": { - "type": "string", - "nullable": true + "type": [ + "string", + "null" + ] }, "custom_attributes": { "type": "object", @@ -1701,7 +1783,10 @@ "type": "string" }, "active_at": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date-time" }, "role": { @@ -1727,12 +1812,16 @@ "type": "boolean" }, "custom_role_id": { - "type": "number", - "nullable": true + "type": [ + "number", + "null" + ] }, "custom_role": { - "type": "object", - "nullable": true + "type": [ + "object", + "null" + ] } } } @@ -1790,7 +1879,10 @@ "description": "The thumbnail of the agent" }, "custom_role_id": { - "type": "integer", + "type": [ + "integer", + "null" + ], "description": "The custom role id of the agent" } } @@ -1835,11 +1927,17 @@ "description": "Script used to load the website widget" }, "welcome_title": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { @@ -1847,7 +1945,10 @@ "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "A greeting message when the user starts the conversation" }, "channel_id": { @@ -1871,7 +1972,10 @@ "description": "Configuration settings for auto assignment" }, "out_of_office_message": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Message to show when agents are out of office" }, "working_hours": { @@ -1889,19 +1993,31 @@ "description": "Whether the inbox is closed for the entire day" }, "open_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox opens (0-23)" }, "open_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox opens (0-59)" }, "close_hour": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Hour when inbox closes (0-23)" }, "close_minutes": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Minutes of the hour when inbox closes (0-59)" }, "open_all_day": { @@ -1916,7 +2032,10 @@ "description": "Timezone configuration for the inbox" }, "callback_webhook_url": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Webhook URL for callbacks" }, "allow_messages_after_resolved": { @@ -1932,7 +2051,10 @@ "description": "Type of sender name to display (e.g., friendly)" }, "business_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Business name associated with the inbox" }, "hmac_mandatory": { @@ -1940,19 +2062,31 @@ "description": "Whether HMAC verification is mandatory" }, "selected_feature_flags": { - "type": "object", - "description": "Selected feature flags for the inbox" + "type": [ + "array", + "null" + ], + "description": "Selected feature flags for the inbox", + "items": { + "type": "string" + } }, "reply_time": { "type": "string", "description": "Expected reply time" }, "messaging_service_sid": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Messaging service SID for SMS providers" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Phone number associated with the inbox" }, "medium": { @@ -1960,7 +2094,10 @@ "description": "Medium of communication (e.g., sms, email)" }, "provider": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Provider of the channel" } } @@ -2195,10 +2332,7 @@ "description": "Cache keys for the account" }, "features": { - "type": "array", - "items": { - "type": "string" - }, + "type": "object", "description": "Enabled features for the account" }, "settings": { @@ -2224,19 +2358,31 @@ "description": "Custom attributes of the account", "properties": { "plan_name": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription plan name" }, "subscribed_quantity": { - "type": "number", + "type": [ + "number", + "null" + ], "description": "Subscribed quantity" }, "subscription_status": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Subscription status" }, "subscription_ends_on": { - "type": "string", + "type": [ + "string", + "null" + ], "format": "date", "description": "Subscription end date" }, @@ -2282,7 +2428,10 @@ "type": "object", "properties": { "latest_chatwoot_version": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Latest version of Chatwoot available", "example": "3.0.0" }, @@ -2343,7 +2492,10 @@ "description": "The name of the team" }, "description": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The description about the team" }, "allow_auto_assign": { @@ -2486,8 +2638,10 @@ "description": "Version number of the audit log entry" }, "comment": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Optional comment associated with the audit log entry" }, "request_uuid": { @@ -2499,8 +2653,10 @@ "description": "Unix timestamp when the audit log entry was created" }, "remote_address": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "IP address from which the action was performed" } } @@ -2736,22 +2892,28 @@ "example": "support@example.com" }, "auto_resolve_after": { - "type": "integer", + "type": [ + "integer", + "null" + ], "minimum": 10, "maximum": 1439856, - "nullable": true, "description": "Auto resolve conversations after specified minutes", "example": 1440 }, "auto_resolve_message": { - "type": "string", - "nullable": true, + "type": [ + "string", + "null" + ], "description": "Message to send when auto resolving", "example": "This conversation has been automatically resolved due to inactivity" }, "auto_resolve_ignore_waiting": { - "type": "boolean", - "nullable": true, + "type": [ + "boolean", + "null" + ], "description": "Whether to ignore waiting conversations for auto resolve", "example": false }, @@ -3155,8 +3317,7 @@ "conversation_create_payload": { "type": "object", "required": [ - "source_id", - "inbox_id" + "source_id" ], "properties": { "source_id": { @@ -4163,7 +4324,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4175,7 +4339,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4183,11 +4350,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4294,7 +4467,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4306,7 +4482,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4314,11 +4493,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4381,7 +4566,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -4393,7 +4581,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -4401,11 +4592,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -4786,18 +4983,24 @@ "description": "Number of conversations resolved in the inbox during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4840,18 +5043,24 @@ "description": "Number of conversations resolved by the agent during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4894,18 +5103,24 @@ "description": "Number of conversations resolved by the team during the date range" }, "avg_resolution_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) to resolve conversations. Null if no data available." }, "avg_first_response_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) for the first response. Null if no data available." }, "avg_reply_time": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "Average time (in seconds) between replies. Null if no data available." } } @@ -4945,7 +5160,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -4967,18 +5185,22 @@ "description": "The ID of the contact" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "thumbnail": { "type": "string", @@ -5030,10 +5252,18 @@ "type": "string", "enum": [ "text", + "input_text", + "input_textarea", + "input_email", "input_select", "cards", "form", - "input_csat" + "article", + "incoming_email", + "input_csat", + "integrations", + "sticker", + "voice_call" ], "description": "The type of the message content" }, @@ -5052,16 +5282,20 @@ "description": "The content attributes for each content_type", "properties": { "in_reply_to": { - "type": "string", - "description": "ID of the message this is replying to", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "ID of the message this is replying to" } } }, "echo_id": { - "type": "string", - "description": "The echo ID of the message, used for deduplication", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The echo ID of the message, used for deduplication" }, "created_at": { "type": "integer", @@ -5072,9 +5306,11 @@ "description": "The flag which shows whether the message is private or not" }, "source_id": { - "type": "string", - "description": "The source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The source ID of the message" }, "sender": { "$ref": "#/components/schemas/contact_detail" @@ -5205,14 +5441,18 @@ "nullable": true }, "agent_last_seen_at": { - "type": "string", - "description": "Timestamp when the agent last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the agent last saw the conversation" }, "assignee_last_seen_at": { - "type": "string", - "description": "Timestamp when the assignee last saw the conversation", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Timestamp when the assignee last saw the conversation" } } }, @@ -5239,7 +5479,10 @@ "description": "Total number of contacts" }, "current_page": { - "type": "string", + "type": [ + "string", + "integer" + ], "description": "Current page number" } } @@ -5275,9 +5518,11 @@ "description": "Type of channel" }, "provider": { - "type": "string", - "description": "Provider of the inbox", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Provider of the inbox" } } } @@ -5299,7 +5544,10 @@ "description": "Country of the contact" }, "country_code": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Country code of the contact" }, "created_at_ip": { @@ -5317,9 +5565,11 @@ ] }, "email": { - "type": "string", - "description": "The email address of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The email address of the contact" }, "id": { "type": "integer", @@ -5330,18 +5580,22 @@ "description": "The name of the contact" }, "phone_number": { - "type": "string", - "description": "The phone number of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The phone number of the contact" }, "blocked": { "type": "boolean", "description": "Whether the contact is blocked" }, "identifier": { - "type": "string", - "description": "The identifier of the contact", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "The identifier of the contact" }, "thumbnail": { "type": "string", @@ -5352,9 +5606,11 @@ "description": "The custom attributes of the contact" }, "last_activity_at": { - "type": "integer", - "description": "Timestamp of last activity", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "Timestamp of last activity" }, "created_at": { "type": "integer", @@ -5436,9 +5692,11 @@ "description": "Status of the message" }, "source_id": { - "type": "string", - "description": "Source ID of the message", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Source ID of the message" }, "content_type": { "type": "string", @@ -5449,14 +5707,18 @@ "description": "Attributes of the content" }, "sender_type": { - "type": "string", - "description": "Type of the sender", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Type of the sender" }, "sender_id": { - "type": "integer", - "description": "ID of the sender", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the sender" }, "external_source_ids": { "type": "object", @@ -5467,9 +5729,11 @@ "description": "Additional attributes of the message" }, "processed_message_content": { - "type": "string", - "description": "Processed message content", - "nullable": true + "type": [ + "string", + "null" + ], + "description": "Processed message content" }, "sentiment": { "type": "object", @@ -5480,9 +5744,11 @@ "description": "Conversation details", "properties": { "assignee_id": { - "type": "integer", - "description": "ID of the assignee", - "nullable": true + "type": [ + "integer", + "null" + ], + "description": "ID of the assignee" }, "unread_count": { "type": "integer", @@ -5568,7 +5834,10 @@ "description": "The availability status of the sender" }, "email": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The email of the sender" }, "id": { @@ -5580,7 +5849,10 @@ "description": "The name of the sender" }, "phone_number": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The phone number of the sender" }, "blocked": { @@ -5588,11 +5860,17 @@ "description": "Whether the sender is blocked" }, "identifier": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "The identifier of the sender" }, "thumbnail": { - "type": "string", + "type": [ + "string", + "null" + ], "description": "Avatar URL of the contact" }, "custom_attributes": { @@ -5678,18 +5956,24 @@ "description": "ID of the account" }, "conversation_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the conversation" }, "inbox_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the inbox" }, "user_id": { - "type": "number", - "nullable": true, + "type": [ + "number", + "null" + ], "description": "ID of the user/agent" }, "created_at": {