diff --git a/swagger/definitions/error/bad_request.yml b/swagger/definitions/error/bad_request.yml index b6facb361..f103edcb5 100644 --- a/swagger/definitions/error/bad_request.yml +++ b/swagger/definitions/error/bad_request.yml @@ -6,4 +6,4 @@ properties: errors: type: array items: - $ref: '#/definitions/request_error' + $ref: '#/components/schemas/request_error' diff --git a/swagger/definitions/index.yml b/swagger/definitions/index.yml index d11ec7988..c4d3eddeb 100644 --- a/swagger/definitions/index.yml +++ b/swagger/definitions/index.yml @@ -5,8 +5,6 @@ bad_request_error: request_error: $ref: ./error/request.yml - - ## ---------- RESOURCE ------------- ## ## -------------------------------- ## @@ -24,10 +22,6 @@ category: $ref: ./resource/category.yml article: $ref: ./resource/article.yml -category: - $ref: ./resource/category.yml -article: - $ref: ./resource/article.yml contact: $ref: ./resource/contact.yml conversation: @@ -71,7 +65,6 @@ public_message: public_inbox: $ref: ./resource/public/inbox.yml - ## ---------- REQUEST------------- ## ## -------------------------------- ## @@ -89,6 +82,7 @@ canned_response_create_update_payload: custom_attribute_create_update_payload: $ref: ./request/custom_attribute/create_update_payload.yml + ## contact contact_create: $ref: ./request/contact/create.yml @@ -128,7 +122,6 @@ category_create_update_payload: article_create_update_payload: $ref: ./request/portal/article_create_update_payload.yml - ## public requests public_contact_create_update_payload: $ref: ./request/public/contact/create_update_payload.yml @@ -147,25 +140,25 @@ public_conversation_create_payload: ## contact extended_contact: allOf: - - $ref: '#/definitions/contact' + - $ref: '#/components/schemas/contact' - $ref: ./resource/extension/contact/show.yml contact_base: allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/contact' + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/contact' contact_list: type: array description: 'array of contacts' items: allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/contact' + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/contact' contact_conversations: type: array description: 'array of conversations' items: allOf: - - $ref: '#/definitions/conversation' + - $ref: '#/components/schemas/conversation' - $ref: ./resource/extension/contact/conversation.yml - $ref: ./resource/extension/conversation/with_display_id.yml contact_labels: @@ -181,7 +174,6 @@ conversation_status_toggle: conversation_labels: $ref: ./resource/extension/conversation/labels.yml - ## report account_summary: $ref: './resource/reports/summary.yml' diff --git a/swagger/definitions/request/conversation/create_message.yml b/swagger/definitions/request/conversation/create_message.yml index b3c9b935b..ba71b9eec 100644 --- a/swagger/definitions/request/conversation/create_message.yml +++ b/swagger/definitions/request/conversation/create_message.yml @@ -13,7 +13,7 @@ properties: description: Flag to identify if it is a private note content_type: type: string - enum: ['text', 'input_email', 'cards', 'input_select', 'form' , 'article'] + enum: ['text', 'input_email', 'cards', 'input_select', 'form', 'article'] example: 'cards' description: 'if you want to create custom message types' content_attributes: @@ -35,8 +35,8 @@ properties: type: string description: Language of the template example: en_US - processed_params: + processed_params: type: object description: The processed param values for template variables in template - example: - 1: "Chatwoot" + example: + 1: 'Chatwoot' diff --git a/swagger/definitions/request/portal/portal_create_update_payload.yml b/swagger/definitions/request/portal/portal_create_update_payload.yml index d1e82aaf4..746f290f1 100644 --- a/swagger/definitions/request/portal/portal_create_update_payload.yml +++ b/swagger/definitions/request/portal/portal_create_update_payload.yml @@ -13,8 +13,8 @@ properties: example: { allowed_locales: ['en', 'es'], default_locale: 'en' } custom_domain: type: string - description: Custom domain to display help center. - example: https://chatwoot.help/. + description: Custom domain to display help center. + example: chatwoot.help header_text: type: string description: Help center header diff --git a/swagger/definitions/resource/agent.yml b/swagger/definitions/resource/agent.yml index e3d506a3b..dd1379b50 100644 --- a/swagger/definitions/resource/agent.yml +++ b/swagger/definitions/resource/agent.yml @@ -19,14 +19,13 @@ properties: enum: ['agent', 'administrator'] confirmed: type: boolean - availability_status: + availability_status: type: string enum: ['available', 'busy', 'offline'] description: The availability status of the agent computed by Chatwoot. auto_offline: type: boolean description: Whether the availability status of agent is configured to go offline automatically when away. - custom_attributes: + custom_attributes: type: object description: Available for users who are created through platform APIs and has custom attributes associated. - diff --git a/swagger/definitions/resource/contact.yml b/swagger/definitions/resource/contact.yml index bbb82e14c..57d5f98af 100644 --- a/swagger/definitions/resource/contact.yml +++ b/swagger/definitions/resource/contact.yml @@ -24,8 +24,9 @@ properties: custom_attributes: type: object description: The object to save custom attributes for contact, accepts custom attributes key and value - example: { attribute_key: attribute_value, signed_up_at: dd/mm/yyyy } + example: + { attribute_key: attribute_value, signed_up_at: dd/mm/yyyy } contact_inboxes: type: array items: - $ref: '#/definitions/contact_inboxes' + $ref: '#/components/schemas/contact_inboxes' diff --git a/swagger/definitions/resource/contact_inboxes.yml b/swagger/definitions/resource/contact_inboxes.yml index a223490ff..7ccba61b1 100644 --- a/swagger/definitions/resource/contact_inboxes.yml +++ b/swagger/definitions/resource/contact_inboxes.yml @@ -5,4 +5,4 @@ properties: description: Contact Inbox Source Id inbox: type: object - $ref: '#/definitions/inbox' + $ref: '#/components/schemas/inbox' diff --git a/swagger/definitions/resource/contactable_inboxes.yml b/swagger/definitions/resource/contactable_inboxes.yml index a223490ff..7ccba61b1 100644 --- a/swagger/definitions/resource/contactable_inboxes.yml +++ b/swagger/definitions/resource/contactable_inboxes.yml @@ -5,4 +5,4 @@ properties: description: Contact Inbox Source Id inbox: type: object - $ref: '#/definitions/inbox' + $ref: '#/components/schemas/inbox' diff --git a/swagger/definitions/resource/conversation.yml b/swagger/definitions/resource/conversation.yml index 085d21879..0a16f0134 100644 --- a/swagger/definitions/resource/conversation.yml +++ b/swagger/definitions/resource/conversation.yml @@ -6,7 +6,7 @@ properties: messages: type: array items: - $ref: '#/definitions/message' + $ref: '#/components/schemas/message' account_id: type: number description: Account Id diff --git a/swagger/definitions/resource/extension/contact/conversation.yml b/swagger/definitions/resource/extension/contact/conversation.yml index 6e6576f80..19936e7e8 100644 --- a/swagger/definitions/resource/extension/contact/conversation.yml +++ b/swagger/definitions/resource/extension/contact/conversation.yml @@ -19,4 +19,4 @@ properties: type: string description: Channel Type assignee: - $ref: '#/definitions/user' + $ref: '#/components/schemas/user' diff --git a/swagger/definitions/resource/extension/conversation/list.yml b/swagger/definitions/resource/extension/conversation/list.yml index 426902d4f..39e04baa0 100644 --- a/swagger/definitions/resource/extension/conversation/list.yml +++ b/swagger/definitions/resource/extension/conversation/list.yml @@ -19,6 +19,6 @@ properties: description: 'array of conversations' items: allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/conversation' + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/conversation' - $ref: '../contact/conversation.yml' diff --git a/swagger/definitions/resource/extension/conversation/show.yml b/swagger/definitions/resource/extension/conversation/show.yml index fb697ad38..27a27018b 100644 --- a/swagger/definitions/resource/extension/conversation/show.yml +++ b/swagger/definitions/resource/extension/conversation/show.yml @@ -1,4 +1,4 @@ type: object allOf: - - $ref: '#/definitions/conversation' + - $ref: '#/components/schemas/conversation' - $ref: '../contact/conversation.yml' diff --git a/swagger/definitions/resource/portal.yml b/swagger/definitions/resource/portal.yml index a1bef33bc..5fb13e9b8 100644 --- a/swagger/definitions/resource/portal.yml +++ b/swagger/definitions/resource/portal.yml @@ -27,8 +27,8 @@ properties: categories: type: array items: - $ref: '#/definitions/category' + $ref: '#/components/schemas/category' articles: type: array items: - $ref: '#/definitions/article' + $ref: '#/components/schemas/article' diff --git a/swagger/definitions/resource/public/contact.yml b/swagger/definitions/resource/public/contact.yml index ae2eae8d3..453ac5c97 100644 --- a/swagger/definitions/resource/public/contact.yml +++ b/swagger/definitions/resource/public/contact.yml @@ -1,5 +1,5 @@ type: object -properties: +properties: id: type: integer description: Id of the contact @@ -14,4 +14,4 @@ properties: description: Email of the contact pubsub_token: type: string - description: The token to be used to connect to chatwoot websocket \ No newline at end of file + description: The token to be used to connect to chatwoot websocket diff --git a/swagger/definitions/resource/public/conversation.yml b/swagger/definitions/resource/public/conversation.yml index a2f797e1b..67febca2d 100644 --- a/swagger/definitions/resource/public/conversation.yml +++ b/swagger/definitions/resource/public/conversation.yml @@ -9,7 +9,7 @@ properties: messages: type: array items: - $ref: '#/definitions/message' + $ref: '#/components/schemas/message' description: Messages in the conversation contact: type: object diff --git a/swagger/definitions/resource/user.yml b/swagger/definitions/resource/user.yml index c06cbab8e..b788713ad 100644 --- a/swagger/definitions/resource/user.yml +++ b/swagger/definitions/resource/user.yml @@ -19,10 +19,10 @@ properties: enum: ['agent', 'administrator'] confirmed: type: boolean - custom_attributes: + custom_attributes: type: object description: Available for users who are created through platform APIs and has custom attributes associated. accounts: type: array items: - $ref: '#/definitions/account' + $ref: '#/components/schemas/account' diff --git a/swagger/index.yml b/swagger/index.yml index 41f78dbc4..bbaefdbd4 100644 --- a/swagger/index.yml +++ b/swagger/index.yml @@ -1,47 +1,39 @@ -swagger: "2.0" +openapi: '3.0.4' info: - description: This is the API documentation for Chatwoot server. - version: 1.0.0 title: Chatwoot - termsOfService: https://www.chatwoot.com/terms-of-service/ + description: This is the API documentation for Chatwoot server. + version: 1.1.0 + termsOfService: https://www.chatwoot.com/terms-of-service/ contact: email: hello@chatwoot.com license: name: MIT License url: https://opensource.org/licenses/MIT -host: app.chatwoot.com -basePath: / -schemes: - - https -produces: -- application/json; charset=utf-8 -consumes: -- application/json; charset=utf-8 -securityDefinitions: - userApiKey: - type: apiKey - in: header - name: api_access_token - description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user. - agentBotApiKey: - type: apiKey - in: header - name: api_access_token - description: This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis. - platformAppApiKey: - type: apiKey - in: header - name: api_access_token - description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles. -security: - - userApiKey: [] - +servers: + - url: https://app.chatwoot.com/ paths: $ref: ./paths/index.yml -definitions: - $ref: ./definitions/index.yml -parameters: - $ref: ./parameters/index.yml +components: + schemas: + $ref: ./definitions/index.yml + parameters: + $ref: ./parameters/index.yml + securitySchemes: + userApiKey: + type: apiKey + in: header + name: api_access_token + description: This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user. + agentBotApiKey: + type: apiKey + in: header + name: api_access_token + description: This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis. + platformAppApiKey: + type: apiKey + in: header + name: api_access_token + description: This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles. x-tagGroups: - name: Platform diff --git a/swagger/parameters/account_id.yml b/swagger/parameters/account_id.yml index aa3d48a8a..133155c21 100644 --- a/swagger/parameters/account_id.yml +++ b/swagger/parameters/account_id.yml @@ -1,5 +1,6 @@ in: path name: account_id -type: integer +schema: + type: integer required: true description: The numeric ID of the account diff --git a/swagger/parameters/agent_bot_id.yml b/swagger/parameters/agent_bot_id.yml index 6c94ef5dc..4d1479cb4 100644 --- a/swagger/parameters/agent_bot_id.yml +++ b/swagger/parameters/agent_bot_id.yml @@ -1,5 +1,6 @@ in: path name: id -type: integer +schema: + type: integer required: true description: The ID of the agentbot to be updated diff --git a/swagger/parameters/contact_sort.yml b/swagger/parameters/contact_sort.yml index 6f3da0b1b..f25d07760 100644 --- a/swagger/parameters/contact_sort.yml +++ b/swagger/parameters/contact_sort.yml @@ -1,14 +1,15 @@ in: query name: sort -type: string -enum: - - name - - email - - phone_number - - last_activity_at - - -name - - -email - - -phone_number - - -last_activity_at +schema: + type: string + enum: + - name + - email + - phone_number + - last_activity_at + - -name + - -email + - -phone_number + - -last_activity_at required: false description: The attribute by which list should be sorted diff --git a/swagger/parameters/conversation_id.yml b/swagger/parameters/conversation_id.yml index d8de755fe..4f4cb19ab 100644 --- a/swagger/parameters/conversation_id.yml +++ b/swagger/parameters/conversation_id.yml @@ -1,5 +1,6 @@ in: path name: conversation_id -type: integer +schema: + type: integer required: true description: The numeric ID of the conversation diff --git a/swagger/parameters/conversation_uuid.yml b/swagger/parameters/conversation_uuid.yml index b2bff7f39..c585ddc09 100644 --- a/swagger/parameters/conversation_uuid.yml +++ b/swagger/parameters/conversation_uuid.yml @@ -1,5 +1,6 @@ in: path name: conversation_uuid -type: integer +schema: + type: integer required: true description: The uuid of the conversation diff --git a/swagger/parameters/custom_filter_id.yml b/swagger/parameters/custom_filter_id.yml index b19f52f8e..46776511f 100644 --- a/swagger/parameters/custom_filter_id.yml +++ b/swagger/parameters/custom_filter_id.yml @@ -1,5 +1,6 @@ in: path name: custom_filter_id -type: integer +schema: + type: integer required: true description: The numeric ID of the custom filter diff --git a/swagger/parameters/hook_id.yml b/swagger/parameters/hook_id.yml index c1600def4..f1c50c3d4 100644 --- a/swagger/parameters/hook_id.yml +++ b/swagger/parameters/hook_id.yml @@ -1,5 +1,6 @@ in: path name: hook_id -type: integer +schema: + type: integer required: true description: The numeric ID of the integration hook diff --git a/swagger/parameters/inbox_id.yml b/swagger/parameters/inbox_id.yml index 716d34de6..58640fb08 100644 --- a/swagger/parameters/inbox_id.yml +++ b/swagger/parameters/inbox_id.yml @@ -1,5 +1,6 @@ in: path name: inbox_id -type: integer +schema: + type: integer required: true description: The ID of the Inbox diff --git a/swagger/parameters/message_id.yml b/swagger/parameters/message_id.yml index 3fc6edfcf..3064a31e2 100644 --- a/swagger/parameters/message_id.yml +++ b/swagger/parameters/message_id.yml @@ -1,5 +1,6 @@ in: path name: message_id -type: integer +schema: + type: integer required: true description: The numeric ID of the message diff --git a/swagger/parameters/page.yml b/swagger/parameters/page.yml index 8cdc77b1e..3ef0f55b6 100644 --- a/swagger/parameters/page.yml +++ b/swagger/parameters/page.yml @@ -1,6 +1,7 @@ in: query name: page -type: integer -default: 1 +schema: + type: integer + default: 1 required: false description: The page parameter diff --git a/swagger/parameters/platform_user_id.yml b/swagger/parameters/platform_user_id.yml index d31f71878..708a0aad9 100644 --- a/swagger/parameters/platform_user_id.yml +++ b/swagger/parameters/platform_user_id.yml @@ -1,5 +1,6 @@ in: path name: id -type: integer +schema: + type: integer required: true description: The numeric ID of the user on the platform diff --git a/swagger/parameters/portal_id.yml b/swagger/parameters/portal_id.yml index b45f69629..bb366550a 100644 --- a/swagger/parameters/portal_id.yml +++ b/swagger/parameters/portal_id.yml @@ -1,5 +1,6 @@ in: path name: portal_id -type: integer +schema: + type: integer required: true description: The numeric ID of the portal diff --git a/swagger/parameters/public/contact_identifier.yml b/swagger/parameters/public/contact_identifier.yml index 6bb522c6b..3dd2d28c2 100644 --- a/swagger/parameters/public/contact_identifier.yml +++ b/swagger/parameters/public/contact_identifier.yml @@ -1,5 +1,6 @@ in: path name: contact_identifier -type: string +schema: + type: string required: true description: The source id of contact obtained on contact create diff --git a/swagger/parameters/public/inbox_identifier.yml b/swagger/parameters/public/inbox_identifier.yml index 091c0d73e..35e33e6c2 100644 --- a/swagger/parameters/public/inbox_identifier.yml +++ b/swagger/parameters/public/inbox_identifier.yml @@ -1,5 +1,6 @@ in: path name: inbox_identifier -type: string +schema: + type: string required: true description: The identifier obtained from API inbox channel diff --git a/swagger/parameters/report_metric.yml b/swagger/parameters/report_metric.yml index 552b0d310..c4bb6cc76 100644 --- a/swagger/parameters/report_metric.yml +++ b/swagger/parameters/report_metric.yml @@ -1,12 +1,13 @@ in: query name: metric -type: string -enum: - - conversations_count - - incoming_messages_count - - outgoing_messages_count - - avg_first_response_time - - avg_resolution_time - - resolutions_count +schema: + type: string + enum: + - conversations_count + - incoming_messages_count + - outgoing_messages_count + - avg_first_response_time + - avg_resolution_time + - resolutions_count required: true description: The type of metric diff --git a/swagger/parameters/report_type.yml b/swagger/parameters/report_type.yml index 9f5fbf363..668fd0922 100644 --- a/swagger/parameters/report_type.yml +++ b/swagger/parameters/report_type.yml @@ -1,11 +1,12 @@ in: query name: type -type: string -enum: - - account - - agent - - inbox - - label - - team +schema: + type: string + enum: + - account + - agent + - inbox + - label + - team required: true description: Type of report diff --git a/swagger/parameters/source_id.yml b/swagger/parameters/source_id.yml index 408beed86..a2c3bb807 100644 --- a/swagger/parameters/source_id.yml +++ b/swagger/parameters/source_id.yml @@ -1,5 +1,6 @@ in: path name: source_id required: true -type: string +schema: + type: string description: "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.

Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String" diff --git a/swagger/parameters/team_id.yml b/swagger/parameters/team_id.yml index c18532b75..9caca20b3 100644 --- a/swagger/parameters/team_id.yml +++ b/swagger/parameters/team_id.yml @@ -1,5 +1,6 @@ in: path name: team_id -type: integer +schema: + type: integer required: true description: The ID of the team to be updated diff --git a/swagger/parameters/webhook_id.yml b/swagger/parameters/webhook_id.yml index 4400a082c..524a3e733 100644 --- a/swagger/parameters/webhook_id.yml +++ b/swagger/parameters/webhook_id.yml @@ -1,5 +1,6 @@ in: path name: webhook_id -type: integer +schema: + type: integer required: true description: The numeric ID of the webhook diff --git a/swagger/paths/application/agent_bots/create.yml b/swagger/paths/application/agent_bots/create.yml index e0fde6184..849c4e45c 100644 --- a/swagger/paths/application/agent_bots/create.yml +++ b/swagger/paths/application/agent_bots/create.yml @@ -3,17 +3,22 @@ tags: operationId: create-an-account-agent-bot summary: Create an Agent Bot description: Create an agent bot in the account -parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/agent_bot_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agent_bots/delete.yml b/swagger/paths/application/agent_bots/delete.yml index 0e3daf6cb..6c83548f1 100644 --- a/swagger/paths/application/agent_bots/delete.yml +++ b/swagger/paths/application/agent_bots/delete.yml @@ -8,5 +8,13 @@ responses: description: Success 401: description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' 404: description: The agent bot does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agent_bots/index.yml b/swagger/paths/application/agent_bots/index.yml index 2c5fe289f..ec940d317 100644 --- a/swagger/paths/application/agent_bots/index.yml +++ b/swagger/paths/application/agent_bots/index.yml @@ -4,13 +4,18 @@ operationId: list-all-account-agent-bots summary: List all AgentBots description: List all agent bots available for the current account responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of agent bots' - items: - $ref: '#/definitions/agent_bot' - - 401: + content: + application/json: + schema: + type: array + description: 'Array of agent bots' + items: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agent_bots/show.yml b/swagger/paths/application/agent_bots/show.yml index b94637690..8dd35c2c9 100644 --- a/swagger/paths/application/agent_bots/show.yml +++ b/swagger/paths/application/agent_bots/show.yml @@ -4,11 +4,21 @@ operationId: get-details-of-a-single-account-agent-bot summary: Get an agent bot details description: Get the details of an agent bot in the account responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given agent bot ID does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agent_bots/update.yml b/swagger/paths/application/agent_bots/update.yml index 562d58841..7db862830 100644 --- a/swagger/paths/application/agent_bots/update.yml +++ b/swagger/paths/application/agent_bots/update.yml @@ -3,16 +3,22 @@ tags: operationId: update-an-account-agent-bot summary: Update an agent bot description: Update an agent bot's attributes -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/agent_bot_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agents/create.yml b/swagger/paths/application/agents/create.yml index dd191d81f..fa5442d02 100644 --- a/swagger/paths/application/agents/create.yml +++ b/swagger/paths/application/agents/create.yml @@ -5,39 +5,45 @@ summary: Add a New Agent description: Add a new Agent to Account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - name - - email - - role - properties: - name: - type: string - description: Full Name of the agent - email: - type: string - description: Email of the Agent - role: - type: string - enum: ['agent', 'administrator'] - description: Whether its administrator or agent - availability_status: - type: string - enum: ['available', 'busy', 'offline'] - description: The availability setting of the agent. - auto_offline: - type: boolean - description: Whether the availability status of agent is configured to go offline automatically when away. +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - name + - email + - role + properties: + name: + type: string + description: Full Name of the agent + email: + type: string + description: Email of the Agent + role: + type: string + enum: ['agent', 'administrator'] + description: Whether its administrator or agent + availability_status: + type: string + enum: ['available', 'busy', 'offline'] + description: The availability setting of the agent. + auto_offline: + type: boolean + description: Whether the availability status of agent is configured to go offline automatically when away. responses: - 200: + '200': description: Success - schema: - description: 'Newly Created Agent' - $ref: '#/definitions/agent' - 403: + content: + application/json: + schema: + description: 'Newly Created Agent' + $ref: '#/components/schemas/agent' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agents/delete.yml b/swagger/paths/application/agents/delete.yml index 118ddf234..d006659e3 100644 --- a/swagger/paths/application/agents/delete.yml +++ b/swagger/paths/application/agents/delete.yml @@ -8,13 +8,22 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true - description: The ID of the agent to be deleted + description: The ID of the agent to be deleted. responses: 200: description: Success 404: description: Agent not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' 403: description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agents/index.yml b/swagger/paths/application/agents/index.yml index 7961ad3b0..2073e2ba0 100644 --- a/swagger/paths/application/agents/index.yml +++ b/swagger/paths/application/agents/index.yml @@ -8,10 +8,16 @@ security: responses: 200: description: Success - schema: - type: array - description: 'Array of all active agents' - items: - $ref: '#/definitions/agent' + content: + application/json: + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/components/schemas/agent' 403: description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/agents/update.yml b/swagger/paths/application/agents/update.yml index a72f5ed4e..5819e87db 100644 --- a/swagger/paths/application/agents/update.yml +++ b/swagger/paths/application/agents/update.yml @@ -8,35 +8,47 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the agent to be updated. - - name: data - in: body - required: true - schema: - type: object - required: - - role - properties: - role: - type: string - enum: ['agent', 'administrator'] - description: Whether its administrator or agent - availability: - type: string - enum: ['available', 'busy', 'offline'] - description: The availability setting of the agent. - auto_offline: - type: boolean - description: Whether the availability status of agent is configured to go offline automatically when away. +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - role + properties: + role: + type: string + enum: ['agent', 'administrator'] + description: Whether its administrator or agent + availability: + type: string + enum: ['available', 'busy', 'offline'] + description: The availability setting of the agent. + auto_offline: + type: boolean + description: Whether the availability status of agent is configured to go offline automatically when away. responses: 200: description: Success - schema: - description: 'The updated agent' - $ref: '#/definitions/agent' + content: + application/json: + schema: + description: 'The updated agent' + $ref: '#/components/schemas/agent' 404: description: Agent not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' 403: description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/article/create.yml b/swagger/paths/application/article/create.yml index 0733fb860..02b13b6c1 100644 --- a/swagger/paths/application/article/create.yml +++ b/swagger/paths/application/article/create.yml @@ -5,16 +5,22 @@ summary: Add a new article description: Add a new article to portal security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/article_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/article_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/article' + content: + application/json: + schema: + $ref: '#/components/schemas/article' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/automation_rule/create.yml b/swagger/paths/application/automation_rule/create.yml index ac5de803a..a8a309dad 100644 --- a/swagger/paths/application/automation_rule/create.yml +++ b/swagger/paths/application/automation_rule/create.yml @@ -5,16 +5,22 @@ summary: Add a new automation rule description: Add a new automation rule to account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/automation_rule_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/automation_rule_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/automation_rule' + content: + application/json: + schema: + $ref: '#/components/schemas/automation_rule' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/automation_rule/delete.yml b/swagger/paths/application/automation_rule/delete.yml index f82647d1d..4d30fb812 100644 --- a/swagger/paths/application/automation_rule/delete.yml +++ b/swagger/paths/application/automation_rule/delete.yml @@ -8,7 +8,8 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the automation rule to be deleted responses: @@ -16,5 +17,13 @@ responses: description: Success '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' '404': description: automation rule not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/automation_rule/index.yml b/swagger/paths/application/automation_rule/index.yml index 031696aeb..e1b78fa37 100644 --- a/swagger/paths/application/automation_rule/index.yml +++ b/swagger/paths/application/automation_rule/index.yml @@ -3,18 +3,24 @@ tags: operationId: get-account-automation-rule summary: List all automation rules in an account parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/page' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/page' description: Get details of automation rules in an Account security: - userApiKey: [] responses: '200': description: Success - schema: - type: array - description: Array of all automation rules - items: - $ref: '#/definitions/automation_rule' + content: + application/json: + schema: + type: array + description: Array of all automation rules + items: + $ref: '#/components/schemas/automation_rule' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/automation_rule/show.yml b/swagger/paths/application/automation_rule/show.yml index d99f8170b..cd53ef478 100644 --- a/swagger/paths/application/automation_rule/show.yml +++ b/swagger/paths/application/automation_rule/show.yml @@ -3,18 +3,31 @@ tags: operationId: get-details-of-a-single-automation-rule summary: Get a automation rule details description: Get the details of a automation rule in the account +security: + - userApiKey: [] parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the automation rule to be updated. responses: '200': description: Success - schema: - $ref: '#/definitions/automation_rule' + content: + application/json: + schema: + $ref: '#/components/schemas/automation_rule' '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' '404': description: The given rule ID does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/automation_rule/update.yml b/swagger/paths/application/automation_rule/update.yml index 35a4cb67a..414885799 100644 --- a/swagger/paths/application/automation_rule/update.yml +++ b/swagger/paths/application/automation_rule/update.yml @@ -8,20 +8,32 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the automation rule to be updated. - - name: data - in: body - required: true - schema: - $ref: '#/definitions/automation_rule_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/automation_rule_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/automation_rule' + content: + application/json: + schema: + $ref: '#/components/schemas/automation_rule' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' '404': description: Rule not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/canned_responses/create.yml b/swagger/paths/application/canned_responses/create.yml index 95eacafb1..95d822a87 100644 --- a/swagger/paths/application/canned_responses/create.yml +++ b/swagger/paths/application/canned_responses/create.yml @@ -5,17 +5,23 @@ summary: Add a New Canned Response description: Add a new Canned Response to Account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/canned_response_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/canned_response_create_update_payload' responses: - 200: + '200': description: Success - schema: - description: 'Newly Created Canned Response' - $ref: '#/definitions/canned_response' - 403: + content: + application/json: + schema: + description: 'Newly Created Canned Response' + $ref: '#/components/schemas/canned_response' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/canned_responses/delete.yml b/swagger/paths/application/canned_responses/delete.yml index 2b1d08238..57ff1850b 100644 --- a/swagger/paths/application/canned_responses/delete.yml +++ b/swagger/paths/application/canned_responses/delete.yml @@ -8,13 +8,22 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the canned response to be deleted responses: - 200: + '200': description: Success - 404: + '404': description: Canned Response not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/canned_responses/index.yml b/swagger/paths/application/canned_responses/index.yml index 3094a23a6..1b8ad694c 100644 --- a/swagger/paths/application/canned_responses/index.yml +++ b/swagger/paths/application/canned_responses/index.yml @@ -6,12 +6,18 @@ description: Get Details of Canned Responses in an Account security: - userApiKey: [] responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all canned responses' - items: - $ref: '#/definitions/canned_response' - 403: + content: + application/json: + schema: + type: array + description: 'Array of all canned responses' + items: + $ref: '#/components/schemas/canned_response' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/canned_responses/update.yml b/swagger/paths/application/canned_responses/update.yml index 7ea801f2f..706b159fd 100644 --- a/swagger/paths/application/canned_responses/update.yml +++ b/swagger/paths/application/canned_responses/update.yml @@ -8,21 +8,33 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the canned response to be updated. - - name: data - in: body - required: true - schema: - $ref: '#/definitions/canned_response_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/canned_response_create_update_payload' responses: - 200: + '200': description: Success - schema: - description: 'The updated canned response' - $ref: '#/definitions/canned_response' - 404: + content: + application/json: + schema: + description: 'The updated canned response' + $ref: '#/components/schemas/canned_response' + '404': description: Agent not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/category/create.yml b/swagger/paths/application/category/create.yml index 7b569a40b..56c757517 100644 --- a/swagger/paths/application/category/create.yml +++ b/swagger/paths/application/category/create.yml @@ -5,16 +5,22 @@ summary: Add a new category description: Add a new category to portal security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/category_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/category_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/category' + content: + application/json: + schema: + $ref: '#/components/schemas/category' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contact_inboxes/create.yml b/swagger/paths/application/contact_inboxes/create.yml index 2b784b5dd..4758ee1a7 100644 --- a/swagger/paths/application/contact_inboxes/create.yml +++ b/swagger/paths/application/contact_inboxes/create.yml @@ -5,34 +5,44 @@ post: description: Create a contact inbox record for an inbox summary: Create contact inbox parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the contact required: true - - name: data - in: body - required: true - schema: - type: object - required: - - inbox_id - properties: - inbox_id: - type: number - description: The ID of the inbox - source_id: - type: string - description: Contact Inbox Source Id + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - inbox_id + properties: + inbox_id: + type: number + description: The ID of the inbox + source_id: + type: string + description: Contact Inbox Source Id responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contact_inboxes' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_inboxes' + '401': description: Authentication error - schema: - $ref: '#/definitions/bad_request_error' - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: Incorrect payload + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contactable_inboxes/get.yml b/swagger/paths/application/contactable_inboxes/get.yml index 23ce37788..7c73c94a7 100644 --- a/swagger/paths/application/contactable_inboxes/get.yml +++ b/swagger/paths/application/contactable_inboxes/get.yml @@ -5,20 +5,29 @@ get: description: Get List of contactable Inboxes summary: Get Contactable Inboxes parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the contact required: true responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contactable_inboxes' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/contactable_inboxes' + '401': description: Authentication error - schema: - $ref: '#/definitions/bad_request_error' - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: Incorrect payload + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/conversations.yml b/swagger/paths/application/contacts/conversations.yml index d08235f5e..8a97a99d2 100644 --- a/swagger/paths/application/contacts/conversations.yml +++ b/swagger/paths/application/contacts/conversations.yml @@ -1,22 +1,41 @@ +parameters: + - $ref: '#/components/parameters/account_id' + - name: id + in: path + required: true + schema: + type: number + description: ID of the contact + get: tags: - Contacts operationId: contactConversations summary: Contact Conversations - description: Get conversations associated to that contact + description: Get conversations associated with that contact parameters: - - $ref: '#/parameters/account_id' - name: id in: path - type: number - description: ID of the contact required: true - responses: - 200: - description: Success schema: - $ref: '#/definitions/contact_conversations' - 404: + type: number + description: ID of the contact + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/contact_conversations' + '404': description: Contact not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/crud.yml b/swagger/paths/application/contacts/crud.yml index 3c982dfe9..1f0da1031 100644 --- a/swagger/paths/application/contacts/crud.yml +++ b/swagger/paths/application/contacts/crud.yml @@ -1,10 +1,11 @@ parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number - description: ID of the contact required: true + schema: + type: number + description: ID of the contact get: tags: @@ -13,14 +14,24 @@ get: summary: Show Contact description: Get a contact belonging to the account using ID responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/extended_contact' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/extended_contact' + '404': description: Contact not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' put: tags: @@ -28,31 +39,50 @@ put: operationId: contactUpdate summary: Update Contact description: Update a contact belonging to the account using ID - parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/contact_update' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/contact_update' responses: - 204: + '204': description: Success - schema: - $ref: '#/definitions/contact_base' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_base' + '404': description: Contact not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' delete: tags: - Contacts operationId: contactDelete summary: Delete Contact + description: Delete a contact belonging to the account using ID responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Contact not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/filter.yml b/swagger/paths/application/contacts/filter.yml index 2a1d53cf7..839d3b275 100644 --- a/swagger/paths/application/contacts/filter.yml +++ b/swagger/paths/application/contacts/filter.yml @@ -9,50 +9,56 @@ security: parameters: - name: page in: query - type: integer - - name: body - in: body - required: true schema: - type: object - properties: - payload: - type: array - items: - type: object - properties: - attribute_key: - type: string - description: filter attribute name - filter_operator: - type: string - description: filter operator name - enum: [ equal_to, not_equal_to, contains, does_not_contain ] - values: - type: array - items: + type: number +requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + payload: + type: array + items: + type: object + properties: + attribute_key: type: string - description: array of the attribute values to filter - query_operator: - type: string - description: query operator name - enum: [ AND, OR ] - example: - - attribute_key: 'name' - filter_operator: 'equal_to' - values: ['en'] - query_operator: 'AND' - - attribute_key: 'country_code' - filter_operator: 'equal_to' - values: ['us'] - query_operator: null + description: filter attribute name + filter_operator: + type: string + description: filter operator name + enum: [equal_to, not_equal_to, contains, does_not_contain] + values: + type: array + items: + type: string + description: array of the attribute values to filter + query_operator: + type: string + description: query operator name + enum: [AND, OR] + example: + - attribute_key: 'name' + filter_operator: 'equal_to' + values: ['en'] + query_operator: 'AND' + - attribute_key: 'country_code' + filter_operator: 'equal_to' + values: ['us'] + query_operator: null responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contact_list' - 400: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_list' + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/labels/create.yml b/swagger/paths/application/contacts/labels/create.yml index 01821d688..5cf4dc22f 100644 --- a/swagger/paths/application/contacts/labels/create.yml +++ b/swagger/paths/application/contacts/labels/create.yml @@ -3,24 +3,37 @@ tags: operationId: contact-add-labels summary: Add Labels description: Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation. -parameters: - - name: data - in: body - required: true - schema: - type: object - properties: - labels: - type: array - description: Array of labels (comma-separated strings) - items: - type: string +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - labels + properties: + labels: + type: array + description: Array of labels (comma-separated strings) + items: + type: string + example: ['support', 'billing'] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contact_labels' - 404: - description: Contact not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_labels' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Contact not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/labels/index.yml b/swagger/paths/application/contacts/labels/index.yml index ad3c7ff81..529634c19 100644 --- a/swagger/paths/application/contacts/labels/index.yml +++ b/swagger/paths/application/contacts/labels/index.yml @@ -4,11 +4,21 @@ operationId: list-all-labels-of-a-contact summary: List Labels description: Lists all the labels of a contact responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contact_labels' - 404: - description: Contact not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_labels' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Contact not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/list_create.yml b/swagger/paths/application/contacts/list_create.yml index 4329ed3b7..4a734d0ce 100644 --- a/swagger/paths/application/contacts/list_create.yml +++ b/swagger/paths/application/contacts/list_create.yml @@ -5,18 +5,22 @@ get: description: Listing all the resolved contacts with pagination (Page size = 15) . Resolved contacts are the ones with a value for identifier, email or phone number summary: List Contacts parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/contact_sort_param' - - $ref: '#/parameters/page' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/contact_sort_param' + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/contact_list' - 400: + content: + application/json: + schema: + $ref: '#/components/schemas/contact_list' + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' post: tags: @@ -25,18 +29,23 @@ post: description: Create a new Contact summary: Create Contact parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/contact_create' + - $ref: '#/components/parameters/account_id' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/contact_create' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/extended_contact' - 400: + content: + application/json: + schema: + $ref: '#/components/schemas/extended_contact' + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/contacts/search.yml b/swagger/paths/application/contacts/search.yml index 63cc11903..3487c1f5b 100644 --- a/swagger/paths/application/contacts/search.yml +++ b/swagger/paths/application/contacts/search.yml @@ -5,22 +5,27 @@ get: description: Search the resolved contacts using a search key, currently supports email search (Page size = 15). Resolved contacts are the ones with a value for identifier, email or phone number summary: Search Contacts parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: q in: query - type: string + schema: + type: string description: Search using contact `name`, `identifier`, `email` or `phone number` - - $ref: '#/parameters/contact_sort_param' - - $ref: '#/parameters/page' + - $ref: '#/components/parameters/contact_sort_param' + - $ref: '#/components/parameters/page' responses: - 200: + '200': description: Success - schema: - type: object - properties: - payload: - $ref: '#/definitions/contact_list' - 401: + content: + application/json: + schema: + type: object + properties: + payload: + $ref: '#/components/schemas/contact_list' + '401': description: Authentication error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/assignments.yml b/swagger/paths/application/conversation/assignments.yml index a67ce59ad..d070fa4cf 100644 --- a/swagger/paths/application/conversation/assignments.yml +++ b/swagger/paths/application/conversation/assignments.yml @@ -6,25 +6,35 @@ description: Assign a conversation to an agent or a team security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - properties: - assignee_id: - type: number - description: Id of the assignee user - team_id: - type: number - description: Id of the team. If the assignee_id is present, this param would be ignored +requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + assignee_id: + type: number + description: Id of the assignee user + team_id: + type: number + description: Id of the team. If the assignee_id is present, this param would be ignored responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/user' - 404: - description: Conversation not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/custom_attributes.yml b/swagger/paths/application/conversation/custom_attributes.yml index bfd416138..fbfe16db9 100644 --- a/swagger/paths/application/conversation/custom_attributes.yml +++ b/swagger/paths/application/conversation/custom_attributes.yml @@ -6,31 +6,41 @@ description: Updates the custom attributes of a conversation security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - custom_attributes - properties: - custom_attributes: - type: object - description: The custom attributes to be set for the conversation - example: - order_id: "12345" - previous_conversation: "67890" +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - custom_attributes + properties: + custom_attributes: + type: object + description: The custom attributes to be set for the conversation + example: + order_id: '12345' + previous_conversation: '67890' responses: - 200: + '200': description: Success - schema: - type: object - properties: - custom_attributes: + content: + application/json: + schema: type: object - description: The custom attributes of the conversation - 404: + properties: + custom_attributes: + type: object + description: The custom attributes of the conversation + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Conversation not found - 401: - description: Unauthorized \ No newline at end of file + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/filter.yml b/swagger/paths/application/conversation/filter.yml index 4ee5f5d54..dcd0a6bf7 100644 --- a/swagger/paths/application/conversation/filter.yml +++ b/swagger/paths/application/conversation/filter.yml @@ -9,50 +9,56 @@ security: parameters: - name: page in: query - type: integer - - name: body - in: body - required: true schema: - type: object - properties: - payload: - type: array - items: - type: object - properties: - attribute_key: - type: string - description: filter attribute name - filter_operator: - type: string - description: filter operator name - enum: [ equal_to, not_equal_to, contains, does_not_contain ] - values: - type: array - items: + type: number +requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + payload: + type: array + items: + type: object + properties: + attribute_key: type: string - description: array of the attribute values to filter - query_operator: - type: string - description: query operator name - enum: [ AND, OR ] - example: - - attribute_key: 'browser_language' - filter_operator: 'not_eq' - values: ['en'] - query_operator: 'AND' - - attribute_key: 'status' - filter_operator: 'eq' - values: ['pending'] - query_operator: null + description: filter attribute name + filter_operator: + type: string + description: filter operator name + enum: [equal_to, not_equal_to, contains, does_not_contain] + values: + type: array + items: + type: string + description: array of the attribute values to filter + query_operator: + type: string + description: query operator name + enum: [AND, OR] + example: + - attribute_key: 'browser_language' + filter_operator: 'not_eq' + values: ['en'] + query_operator: 'AND' + - attribute_key: 'status' + filter_operator: 'eq' + values: ['pending'] + query_operator: null responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_list' - 400: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_list' + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/index.yml b/swagger/paths/application/conversation/index.yml index 6980eb2bd..e36040203 100644 --- a/swagger/paths/application/conversation/index.yml +++ b/swagger/paths/application/conversation/index.yml @@ -1,5 +1,5 @@ parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: tags: @@ -10,46 +10,57 @@ get: parameters: - name: assignee_type in: query - type: string - enum: ['me', 'unassigned', 'all', 'assigned'] - default: 'all' + schema: + type: string + enum: ['me', 'unassigned', 'all', 'assigned'] + default: 'all' description: Filter conversations by assignee type. - name: status in: query - type: string - enum: ['all', 'open', 'resolved', 'pending', 'snoozed'] - default: 'open' + schema: + type: string + enum: ['all', 'open', 'resolved', 'pending', 'snoozed'] + default: 'open' description: Filter by conversation status. - name: q in: query - type: string + schema: + type: string description: Filters conversations with messages containing the search term - name: inbox_id in: query - type: integer + schema: + type: integer - name: team_id in: query - type: integer + schema: + type: integer - name: labels in: query - type: array - items: - type: string + schema: + type: array + items: + type: string - name: page in: query - type: integer - default: 1 + schema: + type: integer + default: 1 description: paginate through conversations responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_list' - 400: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_list' + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' post: tags: @@ -60,85 +71,95 @@ post: security: - userApiKey: [] - agentBotApiKey: [] - parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - source_id - - inbox_id - properties: - source_id: - type: string - description: Conversation source id - inbox_id: - type: string - description: "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email " - contact_id: - type: string - description: Contact Id for which conversation is created - additional_attributes: - type: object - description: Lets you specify attributes like browser information - custom_attributes: - type: object - description: The object to save custom attributes for conversation, accepts custom attributes key and value - example: { attribute_key: attribute_value, priority_conversation_number: 3 } - status: - type: string - enum: ['open', 'resolved', 'pending'] - description: Specify the conversation whether it's pending, open, closed - assignee_id: - type: string - description: Agent Id for assigning a conversation to an agent - team_id: - type: string - description: Team Id for assigning a conversation to a team - message: - type: object - description: The initial message to be sent to the conversation - required: ['content'] - properties: - content: - type: string - description: The content of the message - template_params: - type: object - description: The template params for the message in case of whatsapp Channel - properties: - name: - type: string - description: Name of the template - example: 'sample_issue_resolution' - category: - type: string - description: Category of the template - example: UTILITY - language: - type: string - description: Language of the template - example: en_US - processed_params: - type: object - description: The processed param values for template variables in template - example: - 1: "Chatwoot" + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - source_id + - inbox_id + properties: + source_id: + type: string + description: Conversation source id + inbox_id: + type: string + description: 'Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email ' + contact_id: + type: string + description: Contact Id for which conversation is created + additional_attributes: + type: object + description: Lets you specify attributes like browser information + custom_attributes: + type: object + description: The object to save custom attributes for conversation, accepts custom attributes key and value + example: + { + attribute_key: attribute_value, + priority_conversation_number: 3, + } + status: + type: string + enum: ['open', 'resolved', 'pending'] + description: Specify the conversation whether it's pending, open, closed + assignee_id: + type: string + description: Agent Id for assigning a conversation to an agent + team_id: + type: string + description: Team Id for assigning a conversation to a team + message: + type: object + description: The initial message to be sent to the conversation + required: ['content'] + properties: + content: + type: string + description: The content of the message + template_params: + type: object + description: The template params for the message in case of whatsapp Channel + properties: + name: + type: string + description: Name of the template + example: 'sample_issue_resolution' + category: + type: string + description: Category of the template + example: UTILITY + language: + type: string + description: Language of the template + example: en_US + processed_params: + type: object + description: The processed param values for template variables in template + example: + 1: 'Chatwoot' responses: - 200: + '200': description: Success - schema: - type: object - properties: - id: - type: number - description: ID of the conversation - account_id: - type: number - description: Account Id - inbox_id: - type: number - description: ID of the inbox - 403: + content: + application/json: + schema: + type: object + properties: + id: + type: number + description: ID of the conversation + account_id: + type: number + description: Account Id + inbox_id: + type: number + description: ID of the inbox + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/labels/create.yml b/swagger/paths/application/conversation/labels/create.yml index 0f686ee24..2f3a49fee 100644 --- a/swagger/paths/application/conversation/labels/create.yml +++ b/swagger/paths/application/conversation/labels/create.yml @@ -3,24 +3,37 @@ tags: operationId: conversation-add-labels summary: Add Labels description: Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation. -parameters: - - name: data - in: body - required: true - schema: - type: object - properties: - labels: - type: array - description: Array of labels (comma-separated strings) - items: - type: string +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - labels + properties: + labels: + type: array + description: Array of labels (comma-separated strings) + items: + type: string + example: ['support', 'billing'] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_labels' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_labels' + '404': description: Conversation not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/labels/index.yml b/swagger/paths/application/conversation/labels/index.yml index 107fc0132..95d47cf4a 100644 --- a/swagger/paths/application/conversation/labels/index.yml +++ b/swagger/paths/application/conversation/labels/index.yml @@ -4,11 +4,21 @@ operationId: list-all-labels-of-a-conversation summary: List Labels description: Lists all the labels of a conversation responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_labels' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_labels' + '404': description: Conversation not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/messages/create.yml b/swagger/paths/application/conversation/messages/create.yml index 4ab9e27a0..0c98705a6 100644 --- a/swagger/paths/application/conversation/messages/create.yml +++ b/swagger/paths/application/conversation/messages/create.yml @@ -6,20 +6,30 @@ description: Create a new message in the conversation security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/conversation_message_create' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_message_create' responses: - 200: + '200': description: Success - schema: - allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/message' - 404: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/message' + '404': description: Conversation not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/messages/create_attachment.yml b/swagger/paths/application/conversation/messages/create_attachment.yml index 594f9a819..6030ce6db 100644 --- a/swagger/paths/application/conversation/messages/create_attachment.yml +++ b/swagger/paths/application/conversation/messages/create_attachment.yml @@ -3,46 +3,56 @@ post: - Messages operationId: conversationNewMessageAttachment summary: Create New Message Attachment - description: Create an attachment message. Refer to this discussion if you have any further doubts. https://github.com/chatwoot/chatwoot/discussions/1809#discussioncomment-1211845 - consumes: - - multipart/form-data + description: Create an attachment message. security: - userApiKey: [] - agentBotApiKey: [] parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' - required: true - - in: formData - name: content - type: string - description: The content of the message - required: true - - in: formData - name: message_type - type: string - enum: ['outgoing', 'incoming'] - - in: formData - name: private - type: boolean - description: Flag to identify if it is a private note - - in: formData - name: attachments[] - type: array - description: The files to be uploaded. - items: - type: string - format: binary - + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' + requestBody: + required: true + content: + multipart/form-data: + schema: + type: object + required: + - content + properties: + content: + type: string + description: The content of the message + message_type: + type: string + enum: ['outgoing', 'incoming'] + private: + type: boolean + description: Flag to identify if it is a private note + attachments: + type: array + description: The files to be uploaded. + items: + type: string + format: binary responses: - 200: + '200': description: Success - schema: - allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/message' - 404: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/message' + '404': description: Conversation not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/messages/delete.yml b/swagger/paths/application/conversation/messages/delete.yml index f038074c7..5019f86a1 100644 --- a/swagger/paths/application/conversation/messages/delete.yml +++ b/swagger/paths/application/conversation/messages/delete.yml @@ -4,9 +4,17 @@ operationId: delete-a-message summary: Delete a message description: Delete a message and it's attachments from the conversation. responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The message or conversation does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/messages/index.yml b/swagger/paths/application/conversation/messages/index.yml index d99e8393b..8468c63dc 100644 --- a/swagger/paths/application/conversation/messages/index.yml +++ b/swagger/paths/application/conversation/messages/index.yml @@ -4,16 +4,26 @@ operationId: list-all-messages summary: Get messages description: List all messages of a conversation responses: - 200: + '200': description: Success - schema: - type: array - description: Array of messages - items: - allOf: - - $ref: '#/definitions/generic_id' - - $ref: '#/definitions/message' - 404: + content: + application/json: + schema: + type: array + description: Array of messages + items: + allOf: + - $ref: '#/components/schemas/generic_id' + - $ref: '#/components/schemas/message' + '404': description: Conversation not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/meta.yml b/swagger/paths/application/conversation/meta.yml index 327fb702e..d67591f42 100644 --- a/swagger/paths/application/conversation/meta.yml +++ b/swagger/paths/application/conversation/meta.yml @@ -1,5 +1,5 @@ parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: tags: @@ -10,44 +10,53 @@ get: parameters: - name: status in: query - type: string - enum: ['all', 'open', 'resolved', 'pending', 'snoozed'] - default: 'open' + schema: + type: string + enum: ['all', 'open', 'resolved', 'pending', 'snoozed'] + default: 'open' description: Filter by conversation status. - name: q in: query - type: string + schema: + type: string description: Filters conversations with messages containing the search term - name: inbox_id in: query - type: integer + schema: + type: integer - name: team_id in: query - type: integer + schema: + type: integer - name: labels in: query - type: array - items: - type: string + schema: + type: array + items: + type: string responses: - 200: + '200': description: Success - schema: - type: object - properties: - meta: + content: + application/json: + schema: type: object properties: - mine_count: - type: number - unassigned_count: - type: number - assigned_count: - type: number - all_count: - type: number - 400: + meta: + type: object + properties: + mine_count: + type: number + unassigned_count: + type: number + assigned_count: + type: number + all_count: + type: number + '400': description: Bad Request Error - schema: - $ref: '#/definitions/bad_request_error' \ No newline at end of file + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/show.yml b/swagger/paths/application/conversation/show.yml index 56c3a292b..bf56ff8cd 100644 --- a/swagger/paths/application/conversation/show.yml +++ b/swagger/paths/application/conversation/show.yml @@ -4,11 +4,21 @@ operationId: get-details-of-a-conversation summary: Conversation Details description: Get all details regarding a conversation with all messages in the conversation responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_show' - 404: - description: Conversation not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_show' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/toggle_priority.yml b/swagger/paths/application/conversation/toggle_priority.yml index 22a80c891..79c27ce3a 100644 --- a/swagger/paths/application/conversation/toggle_priority.yml +++ b/swagger/paths/application/conversation/toggle_priority.yml @@ -6,23 +6,31 @@ description: Toggles the priority of conversation security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - priority - properties: - priority: - type: string - enum: ["urgent", "high", "medium", "low", "none"] - description: "The priority of the conversation" +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - priority + properties: + priority: + type: string + enum: ['urgent', 'high', 'medium', 'low', 'none'] + description: 'The priority of the conversation' responses: - 200: + '200': description: Success - 404: - description: Conversation not found - 401: + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/toggle_status.yml b/swagger/paths/application/conversation/toggle_status.yml index 20b18d6aa..96e4231a6 100644 --- a/swagger/paths/application/conversation/toggle_status.yml +++ b/swagger/paths/application/conversation/toggle_status.yml @@ -6,25 +6,35 @@ description: Toggles the status of the conversation between open and resolved security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - status - properties: - status: - type: string - enum: ["open", "resolved", "pending"] - description: The status of the conversation +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - status + properties: + status: + type: string + enum: ['open', 'resolved', 'pending'] + description: The status of the conversation responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/conversation_status_toggle' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/conversation_status_toggle' + '404': description: Conversation not found - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/update.yml b/swagger/paths/application/conversation/update.yml index 3add02635..9a81e2eb4 100644 --- a/swagger/paths/application/conversation/update.yml +++ b/swagger/paths/application/conversation/update.yml @@ -6,24 +6,32 @@ description: Update Conversation Attributes security: - userApiKey: [] - agentBotApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - properties: - priority: - type: string - enum: ["urgent", "high", "medium", "low", "none"] - description: "The priority of the conversation" - sla_policy_id: - type: number - description: "The ID of the SLA policy (Available only in Enterprise edition)" +requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + priority: + type: string + enum: ['urgent', 'high', 'medium', 'low', 'none'] + description: 'The priority of the conversation' + sla_policy_id: + type: number + description: 'The ID of the SLA policy (Available only in Enterprise edition)' responses: - 200: + '200': description: Success - 404: - description: Conversation not found - 401: + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/conversation/update_last_seen.yml b/swagger/paths/application/conversation/update_last_seen.yml index 0f542dd7f..eca5215bc 100644 --- a/swagger/paths/application/conversation/update_last_seen.yml +++ b/swagger/paths/application/conversation/update_last_seen.yml @@ -11,9 +11,17 @@ post: description: ID of the conversation required: true responses: - 200: + '200': description: Success - 404: - description: Contact not found - 403: + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Contact not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_attributes/create.yml b/swagger/paths/application/custom_attributes/create.yml index fa01fc8e4..615dd6c74 100644 --- a/swagger/paths/application/custom_attributes/create.yml +++ b/swagger/paths/application/custom_attributes/create.yml @@ -5,16 +5,22 @@ summary: Add a new custom attribute description: Add a new custom attribute to account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/custom_attribute_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/custom_attribute_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/custom_attribute' - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/custom_attribute' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_attributes/delete.yml b/swagger/paths/application/custom_attributes/delete.yml index 0c9aaedee..313425a71 100644 --- a/swagger/paths/application/custom_attributes/delete.yml +++ b/swagger/paths/application/custom_attributes/delete.yml @@ -6,16 +6,25 @@ description: Remove a custom attribute from account security: - userApiKey: [] parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the custom attribute to be deleted responses: - 200: + '200': description: Success - 404: + '404': description: Custom attribute not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_attributes/index.yml b/swagger/paths/application/custom_attributes/index.yml index a3a91144b..2d61a0925 100644 --- a/swagger/paths/application/custom_attributes/index.yml +++ b/swagger/paths/application/custom_attributes/index.yml @@ -3,22 +3,29 @@ tags: operationId: get-account-custom-attribute summary: List all custom attributes in an account parameters: - - name: attribute_model - in: query + - name: attribute_model + in: query + schema: type: string enum: ['0', '1'] - description: conversation_attribute(0)/contact_attribute(1) - required: true + description: conversation_attribute(0)/contact_attribute(1) + required: true description: Get details of custom attributes in an Account security: - userApiKey: [] responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all custom attributes' - items: - $ref: '#/definitions/custom_attribute' - 403: + content: + application/json: + schema: + type: array + description: 'Array of all custom attributes' + items: + $ref: '#/components/schemas/custom_attribute' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_attributes/show.yml b/swagger/paths/application/custom_attributes/show.yml index 8449ba9be..b5360c068 100644 --- a/swagger/paths/application/custom_attributes/show.yml +++ b/swagger/paths/application/custom_attributes/show.yml @@ -4,18 +4,29 @@ operationId: get-details-of-a-single-custom-attribute summary: Get a custom attribute details description: Get the details of a custom attribute in the account parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the custom attribute to be updated. responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/custom_attribute' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/custom_attribute' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given attribute ID does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_attributes/update.yml b/swagger/paths/application/custom_attributes/update.yml index 4b69f21bd..d3ccc6af1 100644 --- a/swagger/paths/application/custom_attributes/update.yml +++ b/swagger/paths/application/custom_attributes/update.yml @@ -8,21 +8,33 @@ security: parameters: - in: path name: id - type: integer + schema: + type: integer required: true description: The ID of the custom attribute to be updated. - - name: data - in: body - required: true - schema: - $ref: '#/definitions/custom_attribute_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/custom_attribute_create_update_payload' responses: - 200: + '200': description: Success - schema: - description: 'The updated custom attribute' - $ref: '#/definitions/custom_attribute' - 404: + content: + application/json: + schema: + description: 'The updated custom attribute' + $ref: '#/components/schemas/custom_attribute' + '404': description: Agent not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_filters/create.yml b/swagger/paths/application/custom_filters/create.yml index 9d9534976..66f21dad8 100644 --- a/swagger/paths/application/custom_filters/create.yml +++ b/swagger/paths/application/custom_filters/create.yml @@ -4,16 +4,23 @@ operationId: create-a-custom-filter summary: Create a custom filter description: Create a custom filter in the account parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/custom_filter_create_update_payload' + - $ref: '#/components/parameters/account_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/custom_filter_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/custom_filter' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/custom_filter' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_filters/delete.yml b/swagger/paths/application/custom_filters/delete.yml index e66748858..180a38c94 100644 --- a/swagger/paths/application/custom_filters/delete.yml +++ b/swagger/paths/application/custom_filters/delete.yml @@ -4,9 +4,17 @@ operationId: delete-a-custom-filter summary: Delete a custom filter description: Delete a custom filter from the account responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The custom filter does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_filters/index.yml b/swagger/paths/application/custom_filters/index.yml index b77949dc3..c515806ed 100644 --- a/swagger/paths/application/custom_filters/index.yml +++ b/swagger/paths/application/custom_filters/index.yml @@ -4,12 +4,18 @@ operationId: list-all-filters summary: List all custom filters description: List all custom filters in a category of a user responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of custom filters' - items: - $ref: '#/definitions/custom_filter' - 401: + content: + application/json: + schema: + type: array + description: 'Array of custom filters' + items: + $ref: '#/components/schemas/custom_filter' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_filters/show.yml b/swagger/paths/application/custom_filters/show.yml index 14de07d85..18c979772 100644 --- a/swagger/paths/application/custom_filters/show.yml +++ b/swagger/paths/application/custom_filters/show.yml @@ -4,11 +4,21 @@ operationId: get-details-of-a-single-custom-filter summary: Get a custom filter details description: Get the details of a custom filter in the account responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/custom_filter' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/custom_filter' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given team ID does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/custom_filters/update.yml b/swagger/paths/application/custom_filters/update.yml index a058b81f8..d7614f075 100644 --- a/swagger/paths/application/custom_filters/update.yml +++ b/swagger/paths/application/custom_filters/update.yml @@ -3,16 +3,22 @@ tags: operationId: update-a-custom-filter summary: Update a custom filter description: Update a custom filter's attributes -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/custom_filter_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/custom_filter_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/custom_filter' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/custom_filter' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/create.yml b/swagger/paths/application/inboxes/create.yml index 3d649e820..cf3c6d5bf 100644 --- a/swagger/paths/application/inboxes/create.yml +++ b/swagger/paths/application/inboxes/create.yml @@ -5,47 +5,58 @@ post: summary: Create an inbox description: You can create more than one website inbox in each account parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - type: object - properties: - name: - type: string - description: The name of the inbox - avatar: - type: string - format: binary - description: File for avatar image - channel: - type: object - properties: - type: - type: string - enum: ['web_widget'] - website_url: - type: string - description: URL at which the widget will be loaded - welcome_title: - type: string - description: Welcome title to be displayed on the widget - welcome_tagline: - type: string - description: Welcome tagline to be displayed on the widget - agent_away_message: - type: string - description: A message which will be sent if there is not agent available. This is not available if agentbot is connected - widget_color: - type: string - description: A Hex-color string used to customize the widget + - $ref: '#/components/parameters/account_id' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + name: + type: string + description: The name of the inbox + avatar: + type: string + format: binary + description: File for avatar image + channel: + type: object + properties: + type: + type: string + enum: ['web_widget'] + website_url: + type: string + description: URL at which the widget will be loaded + welcome_title: + type: string + description: Welcome title to be displayed on the widget + welcome_tagline: + type: string + description: Welcome tagline to be displayed on the widget + agent_away_message: + type: string + description: A message which will be sent if there is not agent available. This is not available if agentbot is connected + widget_color: + type: string + description: A Hex-color string used to customize the widget responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/inbox' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/inbox' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/get_agent_bot.yml b/swagger/paths/application/inboxes/get_agent_bot.yml index 178151dd3..2e6555f90 100644 --- a/swagger/paths/application/inboxes/get_agent_bot.yml +++ b/swagger/paths/application/inboxes/get_agent_bot.yml @@ -5,18 +5,29 @@ get: summary: Show Inbox Agent Bot description: See if an agent bot is associated to the Inbox parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the inbox required: true responses: - 204: + '204': description: Success - schema: - $ref: '#/definitions/agent_bot' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '404': description: Inbox not found, Agent bot not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/inbox_members/create.yml b/swagger/paths/application/inboxes/inbox_members/create.yml index 9ca5641e6..517f4b7aa 100644 --- a/swagger/paths/application/inboxes/inbox_members/create.yml +++ b/swagger/paths/application/inboxes/inbox_members/create.yml @@ -5,35 +5,49 @@ summary: Add a New Agent description: Add a new Agent to Inbox security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: +requestBody: + required: true + content: + application/json: + schema: + type: object + required: - inbox_id - user_ids - properties: - inbox_id: - type: string - description: The ID of the inbox - user_ids: - type: array - items: - type: integer - description: IDs of users to be added to the inbox + properties: + inbox_id: + type: string + description: The ID of the inbox + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the inbox responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all active agents' - items: - $ref: '#/definitions/agent' - 404: + content: + application/json: + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/components/schemas/agent' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/inbox_members/delete.yml b/swagger/paths/application/inboxes/inbox_members/delete.yml index 78f1435b5..a8df7661a 100644 --- a/swagger/paths/application/inboxes/inbox_members/delete.yml +++ b/swagger/paths/application/inboxes/inbox_members/delete.yml @@ -5,30 +5,42 @@ summary: Remove an Agent from Inbox description: Remove an Agent from Inbox security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - inbox_id - - user_ids - properties: - inbox_id: - type: string - description: The ID of the inbox - user_ids: - type: array - items: - type: integer - description: IDs of users to be deleted from the inbox +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - inbox_id + - user_ids + properties: + inbox_id: + type: string + description: The ID of the inbox + user_ids: + type: array + items: + type: integer + description: IDs of users to be deleted from the inbox responses: - 200: + '200': description: Success - 404: + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/inbox_members/show.yml b/swagger/paths/application/inboxes/inbox_members/show.yml index 57793f520..65ec9f969 100644 --- a/swagger/paths/application/inboxes/inbox_members/show.yml +++ b/swagger/paths/application/inboxes/inbox_members/show.yml @@ -6,16 +6,26 @@ description: Get Details of Agents in an Inbox security: - userApiKey: [] parameters: - - $ref: '#/parameters/inbox_id' + - $ref: '#/components/parameters/inbox_id' responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all active agents' - items: - $ref: '#/definitions/agent' - 404: + content: + application/json: + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/components/schemas/agent' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/inbox_members/update.yml b/swagger/paths/application/inboxes/inbox_members/update.yml index 483b8f6ab..c5594dc0e 100644 --- a/swagger/paths/application/inboxes/inbox_members/update.yml +++ b/swagger/paths/application/inboxes/inbox_members/update.yml @@ -5,35 +5,49 @@ summary: Update Agents in Inbox description: All agents except the one passed in params will be removed security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - inbox_id - - user_ids - properties: - inbox_id: - type: string - description: The ID of the inbox - user_ids: - type: array - items: - type: integer - description: IDs of users to be added to the inbox +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - inbox_id + - user_ids + properties: + inbox_id: + type: string + description: The ID of the inbox + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the inbox responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all active agents' - items: - $ref: '#/definitions/agent' - 404: + content: + application/json: + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/components/schemas/agent' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/index.yml b/swagger/paths/application/inboxes/index.yml index 233488228..03d1344d7 100644 --- a/swagger/paths/application/inboxes/index.yml +++ b/swagger/paths/application/inboxes/index.yml @@ -5,16 +5,26 @@ get: summary: List all inboxes description: List all inboxes available in the current account parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of inboxes' - items: - $ref: '#/definitions/inbox' - 404: + content: + application/json: + schema: + type: array + description: 'Array of inboxes' + items: + $ref: '#/components/schemas/inbox' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/set_agent_bot.yml b/swagger/paths/application/inboxes/set_agent_bot.yml index 56a37d165..d6670718e 100644 --- a/swagger/paths/application/inboxes/set_agent_bot.yml +++ b/swagger/paths/application/inboxes/set_agent_bot.yml @@ -5,27 +5,37 @@ post: summary: Add or remove agent bot description: To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the inbox required: true - - name: data - in: body - required: true - schema: - type: object - required: - - agent_bot - properties: - agent_bot: - type: number - description: 'Agent bot ID' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - agent_bot + properties: + agent_bot: + type: number + description: 'Agent bot ID' responses: - 204: + '204': description: Success - 404: + '404': description: Inbox not found, Agent bot not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/show.yml b/swagger/paths/application/inboxes/show.yml index 6bb2e84a5..ed325a376 100644 --- a/swagger/paths/application/inboxes/show.yml +++ b/swagger/paths/application/inboxes/show.yml @@ -5,18 +5,29 @@ get: summary: Get an inbox description: Get an inbox available in the current account parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the inbox required: true responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/inbox' - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/inbox' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/inboxes/update.yml b/swagger/paths/application/inboxes/update.yml index c5b3aaebf..f40902032 100644 --- a/swagger/paths/application/inboxes/update.yml +++ b/swagger/paths/application/inboxes/update.yml @@ -5,56 +5,68 @@ patch: summary: Update Inbox description: Add avatar and disable auto assignment for an inbox parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the inbox required: true - - name: data - in: body - required: true - schema: - type: object - required: - - enable_auto_assignment - properties: - name: - type: string - description: The name of the inbox - enable_auto_assignment: - type: boolean - description: 'Enable Auto Assignment' - avatar: - type: string - format: binary - description: 'Image file for avatar' - channel: - type: object - properties: - website_url: - type: string - description: URL at which the widget will be loaded - welcome_title: - type: string - description: Welcome title to be displayed on the widget - welcome_tagline: - type: string - description: Welcome tagline to be displayed on the widget - agent_away_message: - type: string - description: A message which will be sent if there is not agent available. This is not available if agentbot is connected - widget_color: - type: string - description: A Hex-color string used to customize the widget + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - enable_auto_assignment + properties: + name: + type: string + description: The name of the inbox + enable_auto_assignment: + type: boolean + description: 'Enable Auto Assignment' + avatar: + type: string + format: binary + description: 'Image file for avatar' + channel: + type: object + properties: + website_url: + type: string + description: URL at which the widget will be loaded + welcome_title: + type: string + description: Welcome title to be displayed on the widget + welcome_tagline: + type: string + description: Welcome tagline to be displayed on the widget + agent_away_message: + type: string + description: A message which will be sent if there is not agent available. This is not available if agentbot is connected + widget_color: + type: string + description: A Hex-color string used to customize the widget responses: - 200: + '200': description: Success - schema: - type: object - description: 'Updated inbox object' - $ref: '#/definitions/inbox' - 404: + content: + application/json: + schema: + type: object + description: 'Updated inbox object' + $ref: '#/components/schemas/inbox' + '404': description: Inbox not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/integrations/apps/show.yml b/swagger/paths/application/integrations/apps/show.yml index 16ce299fe..b62877300 100644 --- a/swagger/paths/application/integrations/apps/show.yml +++ b/swagger/paths/application/integrations/apps/show.yml @@ -4,14 +4,24 @@ operationId: get-details-of-all-integrations summary: List all the Integrations description: Get the details of all Integrations available for the account responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of Integration apps' - items: - $ref: '#/definitions/integrations_app' - 401: + content: + application/json: + schema: + type: array + description: 'Array of Integration apps' + items: + $ref: '#/components/schemas/integrations_app' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Url not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/integrations/hooks/create.yml b/swagger/paths/application/integrations/hooks/create.yml index 42bcb002e..994929995 100644 --- a/swagger/paths/application/integrations/hooks/create.yml +++ b/swagger/paths/application/integrations/hooks/create.yml @@ -4,16 +4,23 @@ operationId: create-an-integration-hook summary: Create an integration hook description: Create an integration hook parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/integrations_hook_create_payload' + - $ref: '#/components/parameters/account_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/integrations_hook_create_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/integrations_hook' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/integrations_hook' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/integrations/hooks/delete.yml b/swagger/paths/application/integrations/hooks/delete.yml index 3e616613b..381bac11d 100644 --- a/swagger/paths/application/integrations/hooks/delete.yml +++ b/swagger/paths/application/integrations/hooks/delete.yml @@ -1,15 +1,23 @@ tags: - - Integrations + - Integrations operationId: delete-an-integration-hook summary: Delete an Integration Hook description: Delete an Integration Hook parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/hook_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/hook_id' responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The hook does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/integrations/hooks/update.yml b/swagger/paths/application/integrations/hooks/update.yml index 2cfd6877a..8345a8876 100644 --- a/swagger/paths/application/integrations/hooks/update.yml +++ b/swagger/paths/application/integrations/hooks/update.yml @@ -4,17 +4,24 @@ operationId: update-an-integrations-hook summary: Update an Integration Hook description: Update an Integration Hook parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/hook_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/integrations_hook_update_payload' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/hook_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/integrations_hook_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/integrations_hook' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/integrations_hook' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/portal/create.yml b/swagger/paths/application/portal/create.yml index 187c20008..b08fc2931 100644 --- a/swagger/paths/application/portal/create.yml +++ b/swagger/paths/application/portal/create.yml @@ -5,16 +5,22 @@ summary: Add a new portal description: Add a new portal to account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/portal_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/portal_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/portal' + content: + application/json: + schema: + $ref: '#/components/schemas/portal' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/portal/index.yml b/swagger/paths/application/portal/index.yml index ea56563a4..5cafe09e5 100644 --- a/swagger/paths/application/portal/index.yml +++ b/swagger/paths/application/portal/index.yml @@ -3,17 +3,23 @@ tags: operationId: get-portal summary: List all portals in an account parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' description: Get details of portals in an Account security: - userApiKey: [] responses: '200': description: Success - schema: - type: array - description: Array of all portals - items: - $ref: '#/definitions/portal' + content: + application/json: + schema: + type: array + description: Array of all portals + items: + $ref: '#/components/schemas/portal' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/portal/update.yml b/swagger/paths/application/portal/update.yml index 8c6a74e85..ea99b98f6 100644 --- a/swagger/paths/application/portal/update.yml +++ b/swagger/paths/application/portal/update.yml @@ -5,16 +5,22 @@ summary: update a new portal description: update a new portal to account security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/portal_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/portal_create_update_payload' responses: '200': description: Success - schema: - $ref: '#/definitions/portal' + content: + application/json: + schema: + $ref: '#/components/schemas/portal' '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/reports/conversation/account.yml b/swagger/paths/application/reports/conversation/account.yml index 28aac72e7..197db0ffe 100644 --- a/swagger/paths/application/reports/conversation/account.yml +++ b/swagger/paths/application/reports/conversation/account.yml @@ -4,20 +4,29 @@ operationId: get-account-conversation-metrics summary: Account Conversation Metrics description: Get conversation metrics for Account responses: - 200: + '200': description: Success - schema: - type: object - description: 'Object of account conversation metrics' - properties: - open: - type: number - unattended: - type: number - unassigned: - type: number - - 404: + content: + application/json: + schema: + type: object + description: 'Object of account conversation metrics' + properties: + open: + type: number + unattended: + type: number + unassigned: + type: number + '404': description: reports not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/reports/conversation/agent.yml b/swagger/paths/application/reports/conversation/agent.yml index 90f433e4a..c69940de9 100644 --- a/swagger/paths/application/reports/conversation/agent.yml +++ b/swagger/paths/application/reports/conversation/agent.yml @@ -4,15 +4,24 @@ operationId: get-agent-conversation-metrics summary: Agent Conversation Metrics description: Get conversation metrics for Agent responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of agent based conversation metrics' - items: - $ref: '#/definitions/agent_conversation_metrics' - - 404: + content: + application/json: + schema: + type: array + description: 'Array of agent based conversation metrics' + items: + $ref: '#/components/schemas/agent_conversation_metrics' + '404': description: reports not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/reports/index.yml b/swagger/paths/application/reports/index.yml index 3d86df38d..1e50317c1 100644 --- a/swagger/paths/application/reports/index.yml +++ b/swagger/paths/application/reports/index.yml @@ -4,19 +4,29 @@ operationId: list-all-conversation-statistics summary: Get Account reports description: Get Account reports for a specific type, metric and date range responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of date based conversation statistics' - items: - type: object - properties: - value: - type: string - timestamp: - type: number - 404: + content: + application/json: + schema: + type: array + description: 'Array of date based conversation statistics' + items: + type: object + properties: + value: + type: string + timestamp: + type: number + '404': description: reports not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/reports/summary.yml b/swagger/paths/application/reports/summary.yml index f9538a9f8..dda671bf7 100644 --- a/swagger/paths/application/reports/summary.yml +++ b/swagger/paths/application/reports/summary.yml @@ -4,12 +4,22 @@ operationId: list-all-conversation-statistics-summary summary: Get Account reports summary description: Get Account reports summary for a specific type and date range responses: - 200: + '200': description: Success - schema: - description: 'Object of summary metrics' - $ref: '#/definitions/account_summary' - 404: + content: + application/json: + schema: + description: 'Object of summary metrics' + $ref: '#/components/schemas/account_summary' + '404': description: reports not found - 403: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/team_members/create.yml b/swagger/paths/application/team_members/create.yml index 724769319..5499f03eb 100644 --- a/swagger/paths/application/team_members/create.yml +++ b/swagger/paths/application/team_members/create.yml @@ -5,31 +5,45 @@ summary: Add a New Agent description: Add a new Agent to Team security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: +requestBody: + required: true + content: + application/json: + schema: + type: object + required: - user_ids - properties: - user_ids: - type: array - items: - type: integer - description: IDs of users to be added to the team + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the team responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all active agents' - items: - $ref: '#/definitions/agent' - 404: - description: Team not found - 403: + content: + application/json: + schema: + type: array + description: 'Array of all active agents' + items: + $ref: '#/components/schemas/agent' + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Team not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/team_members/delete.yml b/swagger/paths/application/team_members/delete.yml index ac7dbb451..99deed83d 100644 --- a/swagger/paths/application/team_members/delete.yml +++ b/swagger/paths/application/team_members/delete.yml @@ -5,27 +5,38 @@ summary: Remove an Agent from Team description: Remove an Agent from Team security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - team_id - - user_ids - properties: - user_ids: - type: array - items: - type: integer - description: IDs of users to be deleted from the team +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - user_ids + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be deleted from the team responses: - 200: + '200': description: Success - 404: - description: Team not found - 403: + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Team not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/team_members/index.yml b/swagger/paths/application/team_members/index.yml index c57705223..dfa505363 100644 --- a/swagger/paths/application/team_members/index.yml +++ b/swagger/paths/application/team_members/index.yml @@ -6,17 +6,27 @@ description: Get Details of Agents in an Team security: - userApiKey: [] parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/team_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/team_id' responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all agents in the team' - items: - $ref: '#/definitions/agent' - 404: - description: Inbox not found - 403: + content: + application/json: + schema: + type: array + description: 'Array of all agents in the team' + items: + $ref: '#/components/schemas/agent' + '403': description: Access denied + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Team not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/team_members/update.yml b/swagger/paths/application/team_members/update.yml index 81034b9c7..efacde3ff 100644 --- a/swagger/paths/application/team_members/update.yml +++ b/swagger/paths/application/team_members/update.yml @@ -5,31 +5,45 @@ summary: Update Agents in Team description: All agents except the one passed in params will be removed security: - userApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - user_ids - properties: - user_ids: - type: array - items: - type: integer - description: IDs of users to be added to the team +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - user_ids + properties: + user_ids: + type: array + items: + type: integer + description: IDs of users to be added to the team responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of all agents in the team' - items: - $ref: '#/definitions/agent' - 404: - description: Team not found - 403: + content: + application/json: + schema: + type: array + description: 'Array of all agents in the team' + items: + $ref: '#/components/schemas/agent' + '403': description: Access denied - 422: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': + description: Team not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '422': description: User must exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/teams/create.yml b/swagger/paths/application/teams/create.yml index 2ec066738..aa7924d50 100644 --- a/swagger/paths/application/teams/create.yml +++ b/swagger/paths/application/teams/create.yml @@ -4,16 +4,23 @@ operationId: create-a-team summary: Create a team description: Create a team in the account parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/team_create_update_payload' + - $ref: '#/components/parameters/account_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/team_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/team' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/team' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/teams/delete.yml b/swagger/paths/application/teams/delete.yml index 7c5698b99..03fcf2622 100644 --- a/swagger/paths/application/teams/delete.yml +++ b/swagger/paths/application/teams/delete.yml @@ -4,9 +4,17 @@ operationId: delete-a-team summary: Delete a team description: Delete a team from the account responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The team does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/teams/index.yml b/swagger/paths/application/teams/index.yml index f93b6a553..915dbe3bc 100644 --- a/swagger/paths/application/teams/index.yml +++ b/swagger/paths/application/teams/index.yml @@ -4,12 +4,18 @@ operationId: list-all-teams summary: List all teams description: List all teams available in the current account responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of teams' - items: - $ref: '#/definitions/team' - 401: + content: + application/json: + schema: + type: array + description: 'Array of teams' + items: + $ref: '#/components/schemas/team' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/teams/show.yml b/swagger/paths/application/teams/show.yml index 485b4730b..fde018aa6 100644 --- a/swagger/paths/application/teams/show.yml +++ b/swagger/paths/application/teams/show.yml @@ -4,11 +4,21 @@ operationId: get-details-of-a-single-team summary: Get a team details description: Get the details of a team in the account responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/team' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/team' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given team ID does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/teams/update.yml b/swagger/paths/application/teams/update.yml index 8afeddc02..90ecb5f67 100644 --- a/swagger/paths/application/teams/update.yml +++ b/swagger/paths/application/teams/update.yml @@ -3,16 +3,22 @@ tags: operationId: update-a-team summary: Update a team description: Update a team's attributes -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/team_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/team_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/team' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/team' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/webhooks/create.yml b/swagger/paths/application/webhooks/create.yml index e4d3053ee..a10a9cf67 100644 --- a/swagger/paths/application/webhooks/create.yml +++ b/swagger/paths/application/webhooks/create.yml @@ -4,16 +4,23 @@ operationId: create-a-webhook summary: Add a webhook description: Add a webhook subscription to the account parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/webhook_create_update_payload' + - $ref: '#/components/parameters/account_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhook_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/webhook' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/webhook' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/webhooks/delete.yml b/swagger/paths/application/webhooks/delete.yml index 525c22dfc..c508acb9b 100644 --- a/swagger/paths/application/webhooks/delete.yml +++ b/swagger/paths/application/webhooks/delete.yml @@ -4,9 +4,17 @@ operationId: delete-a-webhook summary: Delete a webhook description: Delete a webhook from the account responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + type: object + '404': description: The webhook does not exist in the account + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/webhooks/index.yml b/swagger/paths/application/webhooks/index.yml index f96fa00de..d6876fac8 100644 --- a/swagger/paths/application/webhooks/index.yml +++ b/swagger/paths/application/webhooks/index.yml @@ -2,14 +2,20 @@ tags: - Webhooks operationId: list-all-webhooks summary: List all webhooks -description: List all webhooks in the account +description: List all webhooks in the account responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of webhook objects' - items: - $ref: '#/definitions/webhook' - 401: + content: + application/json: + schema: + type: array + description: 'Array of webhook objects' + items: + $ref: '#/components/schemas/webhook' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/application/webhooks/update.yml b/swagger/paths/application/webhooks/update.yml index b395e7362..fc3e3e94e 100644 --- a/swagger/paths/application/webhooks/update.yml +++ b/swagger/paths/application/webhooks/update.yml @@ -4,16 +4,23 @@ operationId: update-a-webhook summary: Update a webhook object description: Update a webhook object in the account parameters: - - $ref: '#/parameters/account_id' - - name: data - in: body - required: true - schema: - $ref: '#/definitions/webhook_create_update_payload' + - $ref: '#/components/parameters/account_id' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/webhook_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/webhook' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/webhook' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/index.yml b/swagger/paths/index.yml index 769f38c27..c8dfacaf4 100644 --- a/swagger/paths/index.yml +++ b/swagger/paths/index.yml @@ -7,7 +7,7 @@ $ref: ./platform/accounts/create.yml /platform/api/v1/accounts/{account_id}: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: './platform/accounts/show.yml' patch: @@ -15,12 +15,11 @@ delete: $ref: ./platform/accounts/delete.yml - # Account Users /platform/api/v1/accounts/{account_id}/account_users: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: './platform/account_users/index.yml' post: @@ -37,7 +36,7 @@ $ref: ./platform/agent_bots/create.yml /platform/api/v1/agent_bots/{id}: parameters: - - $ref: '#/parameters/agent_bot_id' + - $ref: '#/components/parameters/agent_bot_id' get: $ref: './platform/agent_bots/show.yml' patch: @@ -52,7 +51,7 @@ $ref: ./platform/users/create.yml /platform/api/v1/users/{id}: parameters: - - $ref: '#/parameters/platform_user_id' + - $ref: '#/components/parameters/platform_user_id' get: $ref: './platform/users/show.yml' patch: @@ -61,11 +60,10 @@ $ref: ./platform/users/delete.yml /platform/api/v1/users/{id}/login: parameters: - - $ref: '#/parameters/platform_user_id' + - $ref: '#/components/parameters/platform_user_id' get: $ref: './platform/users/login.yml' - # ---------------- end of platform path -----------# # ------------ Public API routes ------------# @@ -74,7 +72,7 @@ /public/api/v1/inboxes/{inbox_identifier}: parameters: - - $ref: '#/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_inbox_identifier' get: $ref: './public/inboxes/show.yml' @@ -82,13 +80,13 @@ /public/api/v1/inboxes/{inbox_identifier}/contacts: parameters: - - $ref: '#/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_inbox_identifier' post: $ref: ./public/inboxes/contacts/create.yml /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' get: $ref: './public/inboxes/contacts/show.yml' patch: @@ -96,66 +94,67 @@ /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' post: $ref: ./public/inboxes/conversations/create.yml get: $ref: ./public/inboxes/conversations/index.yml -/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}: +/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' get: $ref: ./public/inboxes/conversations/show.yml /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_status: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./public/inboxes/conversations/toggle_status.yml /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_typing: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./public/inboxes/conversations/toggle_typing.yml /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/update_last_seen: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./public/inboxes/conversations/update_last_seen.yml /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./public/inboxes/messages/create.yml get: $ref: ./public/inboxes/messages/index.yml + /public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}: parameters: - - $ref: '#/parameters/public_inbox_identifier' - - $ref: '#/parameters/public_contact_identifier' - - $ref: '#/parameters/conversation_id' - - $ref: '#/parameters/message_id' + - $ref: '#/components/parameters/public_inbox_identifier' + - $ref: '#/components/parameters/public_contact_identifier' + - $ref: '#/components/parameters/conversation_id' + - $ref: '#/components/parameters/message_id' patch: $ref: ./public/inboxes/messages/update.yml /api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/public_contact_identifier' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/public_contact_identifier' get: $ref: ./application/contacts/labels/index.yml post: @@ -167,7 +166,7 @@ /survey/responses/{conversation_uuid}: parameters: - - $ref: '#/parameters/conversation_uuid' + - $ref: '#/components/parameters/conversation_uuid' get: $ref: ./survey/show.yml @@ -175,19 +174,18 @@ # ------------ Application API routes ------------# - # AgentBots /api/v1/accounts/{account_id}/agent_bots: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/agent_bots/index.yml post: $ref: ./application/agent_bots/create.yml /api/v1/accounts/{account_id}/agent_bots/{id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/agent_bot_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/agent_bot_id' get: $ref: './application/agent_bots/show.yml' patch: @@ -198,14 +196,14 @@ # Agents /api/v1/accounts/{account_id}/agents: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/agents/index.yml post: $ref: ./application/agents/create.yml /api/v1/accounts/{account_id}/agents/{id}: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' patch: $ref: ./application/agents/update.yml delete: @@ -214,14 +212,14 @@ # Canned Responses /api/v1/accounts/{account_id}/canned_responses: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/canned_responses/index.yml post: $ref: ./application/canned_responses/create.yml /api/v1/accounts/{account_id}/canned_responses/{id}: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' patch: $ref: ./application/canned_responses/update.yml delete: @@ -230,17 +228,18 @@ # Custom Attributes /api/v1/accounts/{account_id}/custom_attribute_definitions: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/custom_attributes/index.yml post: $ref: ./application/custom_attributes/create.yml /api/v1/accounts/{account_id}/custom_attribute_definitions/{id}: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the custom attribute required: true get: @@ -261,7 +260,7 @@ $ref: ./application/contacts/search.yml /api/v1/accounts/{account_id}/contacts/filter: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' post: $ref: ./application/contacts/filter.yml /api/v1/accounts/{account_id}/contacts/{id}/contact_inboxes: @@ -269,21 +268,21 @@ /api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes: $ref: ./application/contactable_inboxes/get.yml - # Automation Rule /api/v1/accounts/{account_id}/automation_rules: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/automation_rule/index.yml post: $ref: ./application/automation_rule/create.yml /api/v1/accounts/{account_id}/automation_rules/{id}: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - name: id in: path - type: number + schema: + type: number description: ID of the Automation Rule required: true get: @@ -293,11 +292,10 @@ delete: $ref: ./application/automation_rule/delete.yml - # Help Center /api/v1/accounts/{account_id}/portals: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' post: $ref: ./application/portal/create.yml get: @@ -305,24 +303,22 @@ patch: $ref: ./application/portal/update.yml - # Help Center category /api/v1/accounts/{account_id}/portals/{portal_id}/categories: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/portal_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/portal_id' post: $ref: ./application/category/create.yml # Help Center article /api/v1/accounts/{account_id}/portals/{portal_id}/articles: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/portal_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/portal_id' post: $ref: ./application/article/create.yml - # Conversations /api/v1/accounts/{account_id}/conversations/meta: $ref: ./application/conversation/meta.yml @@ -330,34 +326,34 @@ $ref: ./application/conversation/index.yml /api/v1/accounts/{account_id}/conversations/filter: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' post: $ref: ./application/conversation/filter.yml /api/v1/accounts/{account_id}/conversations/{conversation_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' get: $ref: ./application/conversation/show.yml patch: $ref: ./application/conversation/update.yml /api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./application/conversation/toggle_status.yml /api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_priority: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./application/conversation/toggle_priority.yml /api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./application/conversation/custom_attributes.yml @@ -365,8 +361,8 @@ /api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' post: $ref: ./application/conversation/assignments.yml @@ -374,14 +370,13 @@ /api/v1/accounts/{account_id}/conversations/{conversation_id}/labels: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' get: $ref: ./application/conversation/labels/index.yml post: $ref: ./application/conversation/labels/create.yml - # Inboxes /api/v1/accounts/{account_id}/inboxes: $ref: ./application/inboxes/index.yml @@ -399,14 +394,14 @@ # Inbox Members /api/v1/accounts/{account_id}/inbox_members/{inbox_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/inbox_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/inbox_id' get: $ref: ./application/inboxes/inbox_members/show.yml /api/v1/accounts/{account_id}/inbox_members: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' post: $ref: ./application/inboxes/inbox_members/create.yml patch: @@ -414,31 +409,27 @@ delete: $ref: ./application/inboxes/inbox_members/delete.yml - - # Messages /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' get: $ref: ./application/conversation/messages/index.yml post: $ref: ./application/conversation/messages/create.yml /api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/conversation_id' - - $ref: '#/parameters/message_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/conversation_id' + - $ref: '#/components/parameters/message_id' delete: $ref: ./application/conversation/messages/delete.yml - - # Integrations /api/v1/accounts/{account_id}/integrations/apps: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: './application/integrations/apps/show.yml' /api/v1/accounts/{account_id}/integrations/hooks: @@ -450,25 +441,22 @@ delete: $ref: ./application/integrations/hooks/delete.yml - - # Profile /api/v1/profile: $ref: ./profile/index.yml - # Teams /api/v1/accounts/{account_id}/teams: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/teams/index.yml post: $ref: ./application/teams/create.yml /api/v1/accounts/{account_id}/teams/{team_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/team_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/team_id' get: $ref: './application/teams/show.yml' patch: @@ -477,8 +465,8 @@ $ref: ./application/teams/delete.yml /api/v1/accounts/{account_id}/teams/{team_id}/team_members: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/team_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/team_id' get: $ref: ./application/team_members/index.yml post: @@ -493,11 +481,12 @@ # Custom Filters /api/v1/accounts/{account_id}/custom_filters: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - in: query name: filter_type - type: string - enum: ['conversation', 'contact', 'report'] + schema: + type: string + enum: ['conversation', 'contact', 'report'] required: false description: The type of custom filter get: @@ -506,8 +495,8 @@ $ref: ./application/custom_filters/create.yml /api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/custom_filter_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/custom_filter_id' get: $ref: './application/custom_filters/show.yml' patch: @@ -518,15 +507,15 @@ # webhooks /api/v1/accounts/{account_id}/webhooks: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' get: $ref: ./application/webhooks/index.yml post: $ref: ./application/webhooks/create.yml /api/v1/accounts/{account_id}/webhooks/{webhook_id}: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/webhook_id' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/webhook_id' patch: $ref: ./application/webhooks/update.yml delete: @@ -537,20 +526,23 @@ # List /api/v2/accounts/{account_id}/reports: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/report_metric' - - $ref: '#/parameters/report_type' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/report_metric' + - $ref: '#/components/parameters/report_type' - in: query name: id - type: string + schema: + type: string description: The Id of specific object in case of agent/inbox/label - in: query name: since - type: string + schema: + type: string description: The timestamp from where report should start. - in: query name: until - type: string + schema: + type: string description: The timestamp from where report should stop. get: $ref: './application/reports/index.yml' @@ -558,19 +550,22 @@ # Summary /api/v2/accounts/{account_id}/reports/summary: parameters: - - $ref: '#/parameters/account_id' - - $ref: '#/parameters/report_type' + - $ref: '#/components/parameters/account_id' + - $ref: '#/components/parameters/report_type' - in: query name: id - type: string + schema: + type: string description: The Id of specific object in case of agent/inbox/label - in: query name: since - type: string + schema: + type: string description: The timestamp from where report should start. - in: query name: until - type: string + schema: + type: string description: The timestamp from where report should stop. get: $ref: './application/reports/summary.yml' @@ -578,12 +573,13 @@ # Conversation metrics for account /api/v2/accounts/{account_id}/reports/conversations: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - in: query name: type - type: string - enum: - - account + schema: + type: string + enum: + - account required: true description: Type of report get: @@ -592,17 +588,19 @@ # Conversation metrics for agent /api/v2/accounts/{account_id}/reports/conversations/: parameters: - - $ref: '#/parameters/account_id' + - $ref: '#/components/parameters/account_id' - in: query name: type - type: string - enum: - - agent + schema: + type: string + enum: + - agent required: true description: Type of report - in: query name: user_id - type: string + schema: + type: string description: The numeric ID of the user get: $ref: './application/reports/conversation/agent.yml' diff --git a/swagger/paths/platform/account_users/create.yml b/swagger/paths/platform/account_users/create.yml index 97dc7127d..d53f7c289 100644 --- a/swagger/paths/platform/account_users/create.yml +++ b/swagger/paths/platform/account_users/create.yml @@ -5,37 +5,44 @@ summary: Create an Account User description: Create an Account User security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - user_id - - role - properties: - user_id: - type: integer - description: The ID of the user - role: - type: string - description: whether user is an administrator or agent - +requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - user_id + - role + properties: + user_id: + type: integer + description: The ID of the user + role: + type: string + description: whether user is an administrator or agent + responses: - 200: + '200': description: Success - schema: - properties: - account_id: - type: integer - description: The ID of the user - user_id: - type: integer - description: The ID of the user - role: - type: string - description: whether user is an administrator or agent - - 401: + content: + application/json: + schema: + type: object + properties: + account_id: + type: integer + description: The ID of the account + user_id: + type: integer + description: The ID of the user + role: + type: string + description: whether user is an administrator or agent + + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/account_users/delete.yml b/swagger/paths/platform/account_users/delete.yml index d864619f7..f2fc35535 100644 --- a/swagger/paths/platform/account_users/delete.yml +++ b/swagger/paths/platform/account_users/delete.yml @@ -5,23 +5,18 @@ summary: Delete an Account User description: Delete an Account User security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - type: object - required: - - user_id - properties: - user_id: - type: integer - description: The ID of the user - responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The account does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/account_users/index.yml b/swagger/paths/platform/account_users/index.yml index bcaed1807..04b773c3c 100644 --- a/swagger/paths/platform/account_users/index.yml +++ b/swagger/paths/platform/account_users/index.yml @@ -6,23 +6,29 @@ description: List all account users security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of account users' - items: - type: object - properties: - account_id: - type: integer - description: The ID of the user - user_id: - type: integer - description: The ID of the user - role: - type: string - description: whether user is an administrator or agent - - 401: + content: + application/json: + schema: + type: array + description: 'Array of account users' + items: + type: object + properties: + account_id: + type: integer + description: The ID of the account + user_id: + type: integer + description: The ID of the user + role: + type: string + description: whether user is an administrator or agent + + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/accounts/create.yml b/swagger/paths/platform/accounts/create.yml index a6e9841b9..a8ea455f5 100644 --- a/swagger/paths/platform/accounts/create.yml +++ b/swagger/paths/platform/accounts/create.yml @@ -5,16 +5,22 @@ summary: Create an Account description: Create an Account security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/account_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/account_create_update_payload' responses: 200: description: Success - schema: - $ref: '#/definitions/platform_account' + content: + application/json: + schema: + $ref: '#/components/schemas/platform_account' 401: description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/accounts/delete.yml b/swagger/paths/platform/accounts/delete.yml index 755b76d1e..d7e25795b 100644 --- a/swagger/paths/platform/accounts/delete.yml +++ b/swagger/paths/platform/accounts/delete.yml @@ -6,9 +6,17 @@ description: Delete an Account security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The account does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/accounts/show.yml b/swagger/paths/platform/accounts/show.yml index d8ec94fe6..1df201701 100644 --- a/swagger/paths/platform/accounts/show.yml +++ b/swagger/paths/platform/accounts/show.yml @@ -6,11 +6,21 @@ description: Get the details of an account security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/platform_account' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/platform_account' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given account does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/accounts/update.yml b/swagger/paths/platform/accounts/update.yml index a70ce9468..a30caea1f 100644 --- a/swagger/paths/platform/accounts/update.yml +++ b/swagger/paths/platform/accounts/update.yml @@ -5,16 +5,22 @@ summary: Update an account description: Update an account's attributes security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/account_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/account_create_update_payload' responses: 200: description: Success - schema: - $ref: '#/definitions/platform_account' + content: + application/json: + schema: + $ref: '#/components/schemas/platform_account' 401: description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/agent_bots/create.yml b/swagger/paths/platform/agent_bots/create.yml index a862ca131..4cb674f56 100644 --- a/swagger/paths/platform/agent_bots/create.yml +++ b/swagger/paths/platform/agent_bots/create.yml @@ -5,16 +5,22 @@ summary: Create an Agent Bot description: Create an agent bot security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/agent_bot_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/agent_bots/delete.yml b/swagger/paths/platform/agent_bots/delete.yml index 676c8f525..a89fed307 100644 --- a/swagger/paths/platform/agent_bots/delete.yml +++ b/swagger/paths/platform/agent_bots/delete.yml @@ -6,9 +6,17 @@ description: Delete an AgentBot security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The agent bot does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/agent_bots/index.yml b/swagger/paths/platform/agent_bots/index.yml index 7ef3ee9c9..054085471 100644 --- a/swagger/paths/platform/agent_bots/index.yml +++ b/swagger/paths/platform/agent_bots/index.yml @@ -6,12 +6,18 @@ description: List all agent bots available security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of agent bots' - items: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + type: array + description: 'Array of agent bots' + items: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/agent_bots/show.yml b/swagger/paths/platform/agent_bots/show.yml index dfbd43a27..d0a8ba37c 100644 --- a/swagger/paths/platform/agent_bots/show.yml +++ b/swagger/paths/platform/agent_bots/show.yml @@ -6,11 +6,21 @@ description: Get the details of an agent bot security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given agent bot ID does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/agent_bots/update.yml b/swagger/paths/platform/agent_bots/update.yml index 842b4854d..ebfd98ee7 100644 --- a/swagger/paths/platform/agent_bots/update.yml +++ b/swagger/paths/platform/agent_bots/update.yml @@ -5,16 +5,22 @@ summary: Update an agent bot description: Update an agent bot's attributes security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/agent_bot_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/agent_bot' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/agent_bot' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/users/create.yml b/swagger/paths/platform/users/create.yml index 7433b8dc6..3d2bdb412 100644 --- a/swagger/paths/platform/users/create.yml +++ b/swagger/paths/platform/users/create.yml @@ -5,16 +5,22 @@ summary: Create a User description: Create a User security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/user_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/user_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/user' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/users/delete.yml b/swagger/paths/platform/users/delete.yml index a7658c215..d26e9d285 100644 --- a/swagger/paths/platform/users/delete.yml +++ b/swagger/paths/platform/users/delete.yml @@ -6,9 +6,17 @@ description: Delete a User security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The user does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/users/login.yml b/swagger/paths/platform/users/login.yml index be210c7aa..9e327e745 100644 --- a/swagger/paths/platform/users/login.yml +++ b/swagger/paths/platform/users/login.yml @@ -6,15 +6,25 @@ description: Get the sso link of a user security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - type: object - properties: - url: - type: string - description: SSO url to autenticate the user - 401: + content: + application/json: + schema: + type: object + properties: + url: + type: string + description: SSO url to autenticate the user + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given user does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/users/show.yml b/swagger/paths/platform/users/show.yml index bf937b49a..e42b3854e 100644 --- a/swagger/paths/platform/users/show.yml +++ b/swagger/paths/platform/users/show.yml @@ -6,11 +6,21 @@ description: Get the details of an user security: - platformAppApiKey: [] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/user' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given user does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/platform/users/update.yml b/swagger/paths/platform/users/update.yml index 56ea0026d..f340448da 100644 --- a/swagger/paths/platform/users/update.yml +++ b/swagger/paths/platform/users/update.yml @@ -5,16 +5,22 @@ summary: Update a user description: Update a user's attributes security: - platformAppApiKey: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/user_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/user_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/user' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/profile/index.yml b/swagger/paths/profile/index.yml index e20004cac..e825b4956 100644 --- a/swagger/paths/profile/index.yml +++ b/swagger/paths/profile/index.yml @@ -5,9 +5,15 @@ get: summary: Fetch user profile description: Get the user profile details responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/user' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/user' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/contacts/create.yml b/swagger/paths/public/inboxes/contacts/create.yml index 51d894f3e..4e8d1f6eb 100644 --- a/swagger/paths/public/inboxes/contacts/create.yml +++ b/swagger/paths/public/inboxes/contacts/create.yml @@ -4,16 +4,22 @@ operationId: create-a-contact summary: Create a contact description: Create a contact security: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/public_contact_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/public_contact_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_contact' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_contact' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/contacts/show.yml b/swagger/paths/public/inboxes/contacts/show.yml index a5d8b8fdc..49039266a 100644 --- a/swagger/paths/public/inboxes/contacts/show.yml +++ b/swagger/paths/public/inboxes/contacts/show.yml @@ -5,11 +5,21 @@ summary: Get a contact description: Get the details of a contact security: [] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_contact' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_contact' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given contact does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/contacts/update.yml b/swagger/paths/public/inboxes/contacts/update.yml index a413c76b3..8134d7bfd 100644 --- a/swagger/paths/public/inboxes/contacts/update.yml +++ b/swagger/paths/public/inboxes/contacts/update.yml @@ -4,16 +4,22 @@ operationId: update-a-contact summary: Update a contact description: Update a contact's attributes security: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/public_contact_create_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/public_contact_create_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_contact' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_contact' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/create.yml b/swagger/paths/public/inboxes/conversations/create.yml index 4c2a85d22..31bd9ac86 100644 --- a/swagger/paths/public/inboxes/conversations/create.yml +++ b/swagger/paths/public/inboxes/conversations/create.yml @@ -4,16 +4,22 @@ operationId: create-a-conversation summary: Create a conversation description: Create a conversation security: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/public_conversation_create_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/public_conversation_create_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_conversation' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_conversation' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/index.yml b/swagger/paths/public/inboxes/conversations/index.yml index bcd598758..c8e0c3648 100644 --- a/swagger/paths/public/inboxes/conversations/index.yml +++ b/swagger/paths/public/inboxes/conversations/index.yml @@ -4,12 +4,18 @@ operationId: list-all-contact-conversations summary: List all conversations description: List all conversations for the contact responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of conversations' - items: - $ref: '#/definitions/public_conversation' - 401: + content: + application/json: + schema: + type: array + description: 'Array of conversations' + items: + $ref: '#/components/schemas/public_conversation' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/show.yml b/swagger/paths/public/inboxes/conversations/show.yml index 2ec6caa63..854b04063 100644 --- a/swagger/paths/public/inboxes/conversations/show.yml +++ b/swagger/paths/public/inboxes/conversations/show.yml @@ -4,11 +4,21 @@ operationId: get-single-conversation summary: Get a single conversation description: Retrieves the details of a specific conversation responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_conversation' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_conversation' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/toggle_status.yml b/swagger/paths/public/inboxes/conversations/toggle_status.yml index cac1c3d8d..734c20cbe 100644 --- a/swagger/paths/public/inboxes/conversations/toggle_status.yml +++ b/swagger/paths/public/inboxes/conversations/toggle_status.yml @@ -4,11 +4,21 @@ operationId: resolve-conversation summary: Resolve a conversation description: Marks a conversation as resolved responses: - 200: + '200': description: Conversation resolved successfully - schema: - $ref: '#/definitions/public_conversation' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_conversation' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/toggle_typing.yml b/swagger/paths/public/inboxes/conversations/toggle_typing.yml index af01c77f6..784e96075 100644 --- a/swagger/paths/public/inboxes/conversations/toggle_typing.yml +++ b/swagger/paths/public/inboxes/conversations/toggle_typing.yml @@ -7,12 +7,21 @@ parameters: - name: typing_status in: query required: true - type: string + schema: + type: string description: Typing status, either 'on' or 'off' responses: - 200: + '200': description: Typing status toggled successfully - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/conversations/update_last_seen.yml b/swagger/paths/public/inboxes/conversations/update_last_seen.yml index 4e56aa11d..29ecfbe51 100644 --- a/swagger/paths/public/inboxes/conversations/update_last_seen.yml +++ b/swagger/paths/public/inboxes/conversations/update_last_seen.yml @@ -4,9 +4,17 @@ operationId: update-last-seen summary: Update last seen description: Updates the last seen time of the contact in a conversation responses: - 200: + '200': description: Last seen updated successfully - 401: + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: Conversation not found + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/messages/create.yml b/swagger/paths/public/inboxes/messages/create.yml index 902090952..1afa7d731 100644 --- a/swagger/paths/public/inboxes/messages/create.yml +++ b/swagger/paths/public/inboxes/messages/create.yml @@ -4,16 +4,22 @@ operationId: create-a-message summary: Create a message description: Create a message security: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/public_message_create_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/public_message_create_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_message' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_message' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/messages/index.yml b/swagger/paths/public/inboxes/messages/index.yml index 0c9eaeab3..4114855e9 100644 --- a/swagger/paths/public/inboxes/messages/index.yml +++ b/swagger/paths/public/inboxes/messages/index.yml @@ -4,12 +4,18 @@ operationId: list-all-converation-messages summary: List all messages description: List all messages in the conversation responses: - 200: + '200': description: Success - schema: - type: array - description: 'Array of messages' - items: - $ref: '#/definitions/public_message' - 401: + content: + application/json: + schema: + type: array + description: 'Array of messages' + items: + $ref: '#/components/schemas/public_message' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/messages/update.yml b/swagger/paths/public/inboxes/messages/update.yml index a211f39ca..38e41beed 100644 --- a/swagger/paths/public/inboxes/messages/update.yml +++ b/swagger/paths/public/inboxes/messages/update.yml @@ -4,16 +4,22 @@ operationId: update-a-message summary: Update a message description: Update a message security: [] -parameters: - - name: data - in: body - required: true - schema: - $ref: '#/definitions/public_message_update_payload' +requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/public_message_update_payload' responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_message' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_message' + '401': description: Unauthorized + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/public/inboxes/show.yml b/swagger/paths/public/inboxes/show.yml index 094caabbf..1effd078b 100644 --- a/swagger/paths/public/inboxes/show.yml +++ b/swagger/paths/public/inboxes/show.yml @@ -5,11 +5,21 @@ summary: Inbox details description: Get the details of an inbox security: [] responses: - 200: + '200': description: Success - schema: - $ref: '#/definitions/public_inbox' - 401: + content: + application/json: + schema: + $ref: '#/components/schemas/public_inbox' + '401': description: Unauthorized - 404: + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' + '404': description: The given inbox does not exist + content: + application/json: + schema: + $ref: '#/components/schemas/bad_request_error' diff --git a/swagger/paths/survey/show.yml b/swagger/paths/survey/show.yml index c2bd1e8e8..ed9c71785 100644 --- a/swagger/paths/survey/show.yml +++ b/swagger/paths/survey/show.yml @@ -5,5 +5,5 @@ summary: Get CSAT survey page description: You can redirect the client to this URL, instead of implementing the CSAT survey component yourself. security: [] responses: - 200: + '200': description: Success diff --git a/swagger/swagger.json b/swagger/swagger.json index 19ef5c904..093abe05a 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -1,9 +1,9 @@ { - "swagger": "2.0", + "openapi": "3.0.4", "info": { - "description": "This is the API documentation for Chatwoot server.", - "version": "1.0.0", "title": "Chatwoot", + "description": "This is the API documentation for Chatwoot server.", + "version": "1.1.0", "termsOfService": "https://www.chatwoot.com/terms-of-service/", "contact": { "email": "hello@chatwoot.com" @@ -13,42 +13,9 @@ "url": "https://opensource.org/licenses/MIT" } }, - "host": "app.chatwoot.com", - "basePath": "/", - "schemes": [ - "https" - ], - "produces": [ - "application/json; charset=utf-8" - ], - "consumes": [ - "application/json; charset=utf-8" - ], - "securityDefinitions": { - "userApiKey": { - "type": "apiKey", - "in": "header", - "name": "api_access_token", - "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user." - }, - "agentBotApiKey": { - "type": "apiKey", - "in": "header", - "name": "api_access_token", - "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis." - }, - "platformAppApiKey": { - "type": "apiKey", - "in": "header", - "name": "api_access_token", - "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles." - } - }, - "security": [ + "servers": [ { - "userApiKey": [ - - ] + "url": "https://app.chatwoot.com/" } ], "paths": { @@ -67,25 +34,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/account_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/account_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/platform_account" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/platform_account" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -93,7 +71,7 @@ "/platform/api/v1/accounts/{account_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -113,15 +91,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/platform_account" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/platform_account" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given account does not exist" + "description": "The given account does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -139,25 +135,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/account_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/account_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/platform_account" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/platform_account" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -180,10 +187,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The account does not exist" + "description": "The account does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -191,7 +212,7 @@ "/platform/api/v1/accounts/{account_id}/account_users": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -211,30 +232,41 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of account users", - "items": { - "type": "object", - "properties": { - "account_id": { - "type": "integer", - "description": "The ID of the user" - }, - "user_id": { - "type": "integer", - "description": "The ID of the user" - }, - "role": { - "type": "string", - "description": "whether user is an administrator or agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of account users", + "items": { + "type": "object", + "properties": { + "account_id": { + "type": "integer", + "description": "The ID of the account" + }, + "user_id": { + "type": "integer", + "description": "The ID of the user" + }, + "role": { + "type": "string", + "description": "whether user is an administrator or agent" + } + } } } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -252,52 +284,64 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "user_id", - "role" - ], - "properties": { - "user_id": { - "type": "integer", - "description": "The ID of the user" - }, - "role": { - "type": "string", - "description": "whether user is an administrator or agent" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "user_id", + "role" + ], + "properties": { + "user_id": { + "type": "integer", + "description": "The ID of the user" + }, + "role": { + "type": "string", + "description": "whether user is an administrator or agent" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "properties": { - "account_id": { - "type": "integer", - "description": "The ID of the user" - }, - "user_id": { - "type": "integer", - "description": "The ID of the user" - }, - "role": { - "type": "string", - "description": "whether user is an administrator or agent" + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "account_id": { + "type": "integer", + "description": "The ID of the account" + }, + "user_id": { + "type": "integer", + "description": "The ID of the user" + }, + "role": { + "type": "string", + "description": "whether user is an administrator or agent" + } + } } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -315,34 +359,29 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "user_id" - ], - "properties": { - "user_id": { - "type": "integer", - "description": "The ID of the user" - } - } - } - } - ], "responses": { "200": { "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The account does not exist" + "description": "The account does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -365,16 +404,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of agent bots", - "items": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of agent bots", + "items": { + "$ref": "#/components/schemas/agent_bot" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -392,25 +442,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agent_bot_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -418,7 +479,7 @@ "/platform/api/v1/agent_bots/{id}": { "parameters": [ { - "$ref": "#/parameters/agent_bot_id" + "$ref": "#/components/parameters/agent_bot_id" } ], "get": { @@ -438,15 +499,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given agent bot ID does not exist" + "description": "The given agent bot ID does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -464,25 +543,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agent_bot_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -505,10 +595,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The agent bot does not exist" + "description": "The agent bot does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -528,25 +632,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/user_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/user" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -554,7 +669,7 @@ "/platform/api/v1/users/{id}": { "parameters": [ { - "$ref": "#/parameters/platform_user_id" + "$ref": "#/components/parameters/platform_user_id" } ], "get": { @@ -574,15 +689,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/user" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given user does not exist" + "description": "The given user does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -600,25 +733,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/user_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/user" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -641,10 +785,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The user does not exist" + "description": "The user does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -652,7 +810,7 @@ "/platform/api/v1/users/{id}/login": { "parameters": [ { - "$ref": "#/parameters/platform_user_id" + "$ref": "#/components/parameters/platform_user_id" } ], "get": { @@ -672,21 +830,39 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "SSO url to autenticate the user" + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "SSO url to autenticate the user" + } + } } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given user does not exist" + "description": "The given user does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -694,7 +870,7 @@ "/public/api/v1/inboxes/{inbox_identifier}": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" } ], "get": { @@ -710,15 +886,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_inbox" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_inbox" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given inbox does not exist" + "description": "The given inbox does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -726,7 +920,7 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" } ], "post": { @@ -739,25 +933,36 @@ "security": [ ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/public_contact_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_contact_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_contact" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_contact" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -765,10 +970,10 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" } ], "get": { @@ -784,15 +989,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_contact" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_contact" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given contact does not exist" + "description": "The given contact does not exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -806,25 +1029,36 @@ "security": [ ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/public_contact_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_contact_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_contact" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_contact" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -832,10 +1066,10 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" } ], "post": { @@ -848,25 +1082,36 @@ "security": [ ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/public_conversation_create_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_conversation_create_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_conversation" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_conversation" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -880,16 +1125,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of conversations", - "items": { - "$ref": "#/definitions/public_conversation" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of conversations", + "items": { + "$ref": "#/components/schemas/public_conversation" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -897,13 +1153,13 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "get": { @@ -916,15 +1172,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_conversation" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_conversation" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -932,13 +1206,13 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_status": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -951,15 +1225,33 @@ "responses": { "200": { "description": "Conversation resolved successfully", - "schema": { - "$ref": "#/definitions/public_conversation" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_conversation" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -967,13 +1259,13 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/toggle_typing": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -988,7 +1280,9 @@ "name": "typing_status", "in": "query", "required": true, - "type": "string", + "schema": { + "type": "string" + }, "description": "Typing status, either 'on' or 'off'" } ], @@ -997,10 +1291,24 @@ "description": "Typing status toggled successfully" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1008,13 +1316,13 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/update_last_seen": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -1029,10 +1337,24 @@ "description": "Last seen updated successfully" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1040,13 +1362,13 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -1059,25 +1381,36 @@ "security": [ ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/public_message_create_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_message_create_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_message" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_message" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1091,16 +1424,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of messages", - "items": { - "$ref": "#/definitions/public_message" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of messages", + "items": { + "$ref": "#/components/schemas/public_message" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1108,16 +1452,16 @@ "/public/api/v1/inboxes/{inbox_identifier}/contacts/{contact_identifier}/conversations/{conversation_id}/messages/{message_id}": { "parameters": [ { - "$ref": "#/parameters/public_inbox_identifier" + "$ref": "#/components/parameters/public_inbox_identifier" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" }, { - "$ref": "#/parameters/message_id" + "$ref": "#/components/parameters/message_id" } ], "patch": { @@ -1130,25 +1474,36 @@ "security": [ ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/public_message_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_message_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/public_message" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/public_message" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1156,10 +1511,10 @@ "/api/v1/accounts/{account_id}/contacts/{contact_identifier}/labels": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/public_contact_identifier" + "$ref": "#/components/parameters/public_contact_identifier" } ], "get": { @@ -1172,15 +1527,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_labels" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_labels" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "404": { - "description": "Contact not found" - }, - "401": { - "description": "Unauthorized" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1191,37 +1564,62 @@ "operationId": "contact-add-labels", "summary": "Add Labels", "description": "Add labels to a contact. Note that this API would overwrite the existing list of labels associated to the conversation.", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "labels": { - "type": "array", - "description": "Array of labels (comma-separated strings)", - "items": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "labels" + ], + "properties": { + "labels": { + "type": "array", + "description": "Array of labels (comma-separated strings)", + "items": { + "type": "string" + }, + "example": [ + "support", + "billing" + ] } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_labels" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_labels" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "404": { - "description": "Contact not found" - }, - "401": { - "description": "Unauthorized" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1229,7 +1627,7 @@ "/survey/responses/{conversation_uuid}": { "parameters": [ { - "$ref": "#/parameters/conversation_uuid" + "$ref": "#/components/parameters/conversation_uuid" } ], "get": { @@ -1252,7 +1650,7 @@ "/api/v1/accounts/{account_id}/agent_bots": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -1265,16 +1663,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of agent bots", - "items": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of agent bots", + "items": { + "$ref": "#/components/schemas/agent_bot" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1285,28 +1694,36 @@ "operationId": "create-an-account-agent-bot", "summary": "Create an Agent Bot", "description": "Create an agent bot in the account", - "parameters": [ - { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agent_bot_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1314,10 +1731,10 @@ "/api/v1/accounts/{account_id}/agent_bots/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/agent_bot_id" + "$ref": "#/components/parameters/agent_bot_id" } ], "get": { @@ -1330,15 +1747,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given agent bot ID does not exist in the account" + "description": "The given agent bot ID does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1349,25 +1784,36 @@ "operationId": "update-an-account-agent-bot", "summary": "Update an agent bot", "description": "Update an agent bot's attributes", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/agent_bot_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1383,10 +1829,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The agent bot does not exist in the account" + "description": "The agent bot does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1394,7 +1854,7 @@ "/api/v1/accounts/{account_id}/agents": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -1414,16 +1874,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all active agents", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/components/schemas/agent" + } + } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1441,61 +1912,72 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "name", - "email", - "role" - ], - "properties": { - "name": { - "type": "string", - "description": "Full Name of the agent" - }, - "email": { - "type": "string", - "description": "Email of the Agent" - }, - "role": { - "type": "string", - "enum": [ - "agent", - "administrator" - ], - "description": "Whether its administrator or agent" - }, - "availability_status": { - "type": "string", - "enum": [ - "available", - "busy", - "offline" - ], - "description": "The availability setting of the agent." - }, - "auto_offline": { - "type": "boolean", - "description": "Whether the availability status of agent is configured to go offline automatically when away." + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name", + "email", + "role" + ], + "properties": { + "name": { + "type": "string", + "description": "Full Name of the agent" + }, + "email": { + "type": "string", + "description": "Email of the Agent" + }, + "role": { + "type": "string", + "enum": [ + "agent", + "administrator" + ], + "description": "Whether its administrator or agent" + }, + "availability_status": { + "type": "string", + "enum": [ + "available", + "busy", + "offline" + ], + "description": "The availability setting of the agent." + }, + "auto_offline": { + "type": "boolean", + "description": "Whether the availability status of agent is configured to go offline automatically when away." + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1503,7 +1985,7 @@ "/api/v1/accounts/{account_id}/agents/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "patch": { @@ -1524,57 +2006,79 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the agent to be updated." - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "role" - ], - "properties": { - "role": { - "type": "string", - "enum": [ - "agent", - "administrator" - ], - "description": "Whether its administrator or agent" - }, - "availability": { - "type": "string", - "enum": [ - "available", - "busy", - "offline" - ], - "description": "The availability setting of the agent." - }, - "auto_offline": { - "type": "boolean", - "description": "Whether the availability status of agent is configured to go offline automatically when away." + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "role" + ], + "properties": { + "role": { + "type": "string", + "enum": [ + "agent", + "administrator" + ], + "description": "Whether its administrator or agent" + }, + "availability": { + "type": "string", + "enum": [ + "available", + "busy", + "offline" + ], + "description": "The availability setting of the agent." + }, + "auto_offline": { + "type": "boolean", + "description": "Whether the availability status of agent is configured to go offline automatically when away." + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent" + } + } } }, "404": { - "description": "Agent not found" + "description": "Agent not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1596,9 +2100,11 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, - "description": "The ID of the agent to be deleted" + "description": "The ID of the agent to be deleted." } ], "responses": { @@ -1606,10 +2112,24 @@ "description": "Success" }, "404": { - "description": "Agent not found" + "description": "Agent not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1617,7 +2137,7 @@ "/api/v1/accounts/{account_id}/canned_responses": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -1637,16 +2157,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all canned responses", - "items": { - "$ref": "#/definitions/canned_response" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all canned responses", + "items": { + "$ref": "#/components/schemas/canned_response" + } + } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1664,25 +2195,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/canned_response_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/canned_response_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/canned_response" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/canned_response" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1690,7 +2232,7 @@ "/api/v1/accounts/{account_id}/canned_responses/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "patch": { @@ -1711,31 +2253,53 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the canned response to be updated." - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/canned_response_create_update_payload" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/canned_response_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/canned_response" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/canned_response" + } + } } }, "404": { - "description": "Agent not found" + "description": "Agent not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1757,7 +2321,9 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the canned response to be deleted" } @@ -1767,10 +2333,24 @@ "description": "Success" }, "404": { - "description": "Canned Response not found" + "description": "Canned Response not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1778,7 +2358,7 @@ "/api/v1/accounts/{account_id}/custom_attribute_definitions": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -1791,11 +2371,13 @@ { "name": "attribute_model", "in": "query", - "type": "string", - "enum": [ - "0", - "1" - ], + "schema": { + "type": "string", + "enum": [ + "0", + "1" + ] + }, "description": "conversation_attribute(0)/contact_attribute(1)", "required": true } @@ -1811,16 +2393,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all custom attributes", - "items": { - "$ref": "#/definitions/custom_attribute" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all custom attributes", + "items": { + "$ref": "#/components/schemas/custom_attribute" + } + } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1838,25 +2431,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/custom_attribute_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_attribute_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_attribute" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_attribute" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -1864,12 +2468,14 @@ "/api/v1/accounts/{account_id}/custom_attribute_definitions/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the custom attribute", "required": true } @@ -1883,12 +2489,14 @@ "description": "Get the details of a custom attribute in the account", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the custom attribute to be updated." } @@ -1896,15 +2504,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_attribute" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_attribute" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given attribute ID does not exist in the account" + "description": "The given attribute ID does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1926,31 +2552,53 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the custom attribute to be updated." - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/custom_attribute_create_update_payload" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_attribute_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_attribute" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_attribute" + } + } } }, "404": { - "description": "Agent not found" + "description": "Agent not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -1970,12 +2618,14 @@ ], "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the custom attribute to be deleted" } @@ -1985,10 +2635,24 @@ "description": "Success" }, "404": { - "description": "Custom attribute not found" + "description": "Custom attribute not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2003,26 +2667,34 @@ "summary": "List Contacts", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/contact_sort_param" + "$ref": "#/components/parameters/contact_sort_param" }, { - "$ref": "#/parameters/page" + "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_list" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_list" + } + } } }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -2036,28 +2708,38 @@ "summary": "Create Contact", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/contact_create" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_create" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/extended_contact" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/extended_contact" + } + } } }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -2066,14 +2748,16 @@ "/api/v1/accounts/{account_id}/contacts/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", - "description": "ID of the contact", - "required": true + "required": true, + "schema": { + "type": "number" + }, + "description": "ID of the contact" } ], "get": { @@ -2086,15 +2770,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/extended_contact" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/extended_contact" + } + } } }, "404": { - "description": "Contact not found" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2105,28 +2807,46 @@ "operationId": "contactUpdate", "summary": "Update Contact", "description": "Update a contact belonging to the account using ID", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/contact_update" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_update" + } } } - ], + }, "responses": { "204": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_base" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_base" + } + } } }, "404": { - "description": "Contact not found" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2136,51 +2856,97 @@ ], "operationId": "contactDelete", "summary": "Delete Contact", + "description": "Delete a contact belonging to the account using ID", "responses": { "200": { "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Contact not found" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } }, "/api/v1/accounts/{account_id}/contacts/{id}/conversations": { + "parameters": [ + { + "$ref": "#/components/parameters/account_id" + }, + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "number" + }, + "description": "ID of the contact" + } + ], "get": { "tags": [ "Contacts" ], "operationId": "contactConversations", "summary": "Contact Conversations", - "description": "Get conversations associated to that contact", + "description": "Get conversations associated with that contact", "parameters": [ - { - "$ref": "#/parameters/account_id" - }, { "name": "id", "in": "path", - "type": "number", - "description": "ID of the contact", - "required": true + "required": true, + "schema": { + "type": "number" + }, + "description": "ID of the contact" } ], "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_conversations" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_conversations" + } + } } }, "404": { - "description": "Contact not found" + "description": "Contact not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2195,37 +2961,47 @@ "summary": "Search Contacts", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "q", "in": "query", - "type": "string", + "schema": { + "type": "string" + }, "description": "Search using contact `name`, `identifier`, `email` or `phone number`" }, { - "$ref": "#/parameters/contact_sort_param" + "$ref": "#/components/parameters/contact_sort_param" }, { - "$ref": "#/parameters/page" + "$ref": "#/components/parameters/page" } ], "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "properties": { - "payload": { - "$ref": "#/definitions/contact_list" + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "payload": { + "$ref": "#/components/schemas/contact_list" + } + } } } } }, "401": { "description": "Authentication error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -2234,7 +3010,7 @@ "/api/v1/accounts/{account_id}/contacts/filter": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "post": { @@ -2260,85 +3036,97 @@ { "name": "page", "in": "query", - "type": "integer" - }, - { - "name": "body", - "in": "body", - "required": true, "schema": { - "type": "object", - "properties": { - "payload": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attribute_key": { - "type": "string", - "description": "filter attribute name" - }, - "filter_operator": { - "type": "string", - "description": "filter operator name", - "enum": [ - "equal_to", - "not_equal_to", - "contains", - "does_not_contain" - ] - }, - "values": { - "type": "array", - "items": { - "type": "string" + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "payload": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attribute_key": { + "type": "string", + "description": "filter attribute name" }, - "description": "array of the attribute values to filter" - }, - "query_operator": { - "type": "string", - "description": "query operator name", - "enum": [ - "AND", - "OR" - ] + "filter_operator": { + "type": "string", + "description": "filter operator name", + "enum": [ + "equal_to", + "not_equal_to", + "contains", + "does_not_contain" + ] + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "array of the attribute values to filter" + }, + "query_operator": { + "type": "string", + "description": "query operator name", + "enum": [ + "AND", + "OR" + ] + } } - } - }, - "example": [ - { - "attribute_key": "name", - "filter_operator": "equal_to", - "values": [ - "en" - ], - "query_operator": "AND" }, - { - "attribute_key": "country_code", - "filter_operator": "equal_to", - "values": [ - "us" - ], - "query_operator": null - } - ] + "example": [ + { + "attribute_key": "name", + "filter_operator": "equal_to", + "values": [ + "en" + ], + "query_operator": "AND" + }, + { + "attribute_key": "country_code", + "filter_operator": "equal_to", + "values": [ + "us" + ], + "query_operator": null + } + ] + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_list" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_list" + } + } } }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -2354,52 +3142,71 @@ "summary": "Create contact inbox", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the contact", "required": true - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number", - "description": "The ID of the inbox" - }, - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "inbox_id" + ], + "properties": { + "inbox_id": { + "type": "number", + "description": "The ID of the inbox" + }, + "source_id": { + "type": "string", + "description": "Contact Inbox Source Id" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contact_inboxes" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contact_inboxes" + } + } } }, "401": { "description": "Authentication error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "422": { - "description": "Incorrect payload" + "description": "Incorrect payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2414,12 +3221,14 @@ "summary": "Get Contactable Inboxes", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the contact", "required": true } @@ -2427,18 +3236,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/contactable_inboxes" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/contactable_inboxes" + } + } } }, "401": { "description": "Authentication error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "422": { - "description": "Incorrect payload" + "description": "Incorrect payload", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2446,7 +3270,7 @@ "/api/v1/accounts/{account_id}/automation_rules": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -2457,10 +3281,10 @@ "summary": "List all automation rules in an account", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/page" + "$ref": "#/components/parameters/page" } ], "description": "Get details of automation rules in an Account", @@ -2474,16 +3298,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all automation rules", - "items": { - "$ref": "#/definitions/automation_rule" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all automation rules", + "items": { + "$ref": "#/components/schemas/automation_rule" + } + } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2501,25 +3336,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/automation_rule_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automation_rule_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/automation_rule" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automation_rule" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2527,12 +3373,14 @@ "/api/v1/accounts/{account_id}/automation_rules/{id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the Automation Rule", "required": true } @@ -2544,11 +3392,20 @@ "operationId": "get-details-of-a-single-automation-rule", "summary": "Get a automation rule details", "description": "Get the details of a automation rule in the account", + "security": [ + { + "userApiKey": [ + + ] + } + ], "parameters": [ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the automation rule to be updated." } @@ -2556,15 +3413,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/automation_rule" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automation_rule" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given rule ID does not exist in the account" + "description": "The given rule ID does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2586,31 +3461,53 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the automation rule to be updated." - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/automation_rule_create_update_payload" - } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automation_rule_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/automation_rule" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/automation_rule" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Rule not found" + "description": "Rule not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2632,7 +3529,9 @@ { "in": "path", "name": "id", - "type": "integer", + "schema": { + "type": "integer" + }, "required": true, "description": "The ID of the automation rule to be deleted" } @@ -2642,10 +3541,24 @@ "description": "Success" }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "automation rule not found" + "description": "automation rule not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2653,7 +3566,7 @@ "/api/v1/accounts/{account_id}/portals": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "post": { @@ -2670,25 +3583,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/portal_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/portal_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/portal" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/portal" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2700,7 +3624,7 @@ "summary": "List all portals in an account", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "description": "Get details of portals in an Account", @@ -2714,16 +3638,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all portals", - "items": { - "$ref": "#/definitions/portal" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all portals", + "items": { + "$ref": "#/components/schemas/portal" + } + } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -2741,25 +3676,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/portal_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/portal_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/portal" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/portal" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2767,10 +3713,10 @@ "/api/v1/accounts/{account_id}/portals/{portal_id}/categories": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/portal_id" + "$ref": "#/components/parameters/portal_id" } ], "post": { @@ -2787,25 +3733,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/category_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/category_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/category" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/category" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2813,10 +3770,10 @@ "/api/v1/accounts/{account_id}/portals/{portal_id}/articles": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/portal_id" + "$ref": "#/components/parameters/portal_id" } ], "post": { @@ -2833,25 +3790,36 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/article_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/article_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/article" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/article" + } + } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -2859,7 +3827,7 @@ "/api/v1/accounts/{account_id}/conversations/meta": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -2873,62 +3841,76 @@ { "name": "status", "in": "query", - "type": "string", - "enum": [ - "all", - "open", - "resolved", - "pending", - "snoozed" - ], - "default": "open", + "schema": { + "type": "string", + "enum": [ + "all", + "open", + "resolved", + "pending", + "snoozed" + ], + "default": "open" + }, "description": "Filter by conversation status." }, { "name": "q", "in": "query", - "type": "string", + "schema": { + "type": "string" + }, "description": "Filters conversations with messages containing the search term" }, { "name": "inbox_id", "in": "query", - "type": "integer" + "schema": { + "type": "integer" + } }, { "name": "team_id", "in": "query", - "type": "integer" + "schema": { + "type": "integer" + } }, { "name": "labels", "in": "query", - "type": "array", - "items": { - "type": "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } } ], "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "properties": { - "meta": { + "content": { + "application/json": { + "schema": { "type": "object", "properties": { - "mine_count": { - "type": "number" - }, - "unassigned_count": { - "type": "number" - }, - "assigned_count": { - "type": "number" - }, - "all_count": { - "type": "number" + "meta": { + "type": "object", + "properties": { + "mine_count": { + "type": "number" + }, + "unassigned_count": { + "type": "number" + }, + "assigned_count": { + "type": "number" + }, + "all_count": { + "type": "number" + } + } } } } @@ -2937,8 +3919,12 @@ }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -2947,7 +3933,7 @@ "/api/v1/accounts/{account_id}/conversations": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -2961,73 +3947,95 @@ { "name": "assignee_type", "in": "query", - "type": "string", - "enum": [ - "me", - "unassigned", - "all", - "assigned" - ], - "default": "all", + "schema": { + "type": "string", + "enum": [ + "me", + "unassigned", + "all", + "assigned" + ], + "default": "all" + }, "description": "Filter conversations by assignee type." }, { "name": "status", "in": "query", - "type": "string", - "enum": [ - "all", - "open", - "resolved", - "pending", - "snoozed" - ], - "default": "open", + "schema": { + "type": "string", + "enum": [ + "all", + "open", + "resolved", + "pending", + "snoozed" + ], + "default": "open" + }, "description": "Filter by conversation status." }, { "name": "q", "in": "query", - "type": "string", + "schema": { + "type": "string" + }, "description": "Filters conversations with messages containing the search term" }, { "name": "inbox_id", "in": "query", - "type": "integer" + "schema": { + "type": "integer" + } }, { "name": "team_id", "in": "query", - "type": "integer" + "schema": { + "type": "integer" + } }, { "name": "labels", "in": "query", - "type": "array", - "items": { - "type": "string" + "schema": { + "type": "array", + "items": { + "type": "string" + } } }, { "name": "page", "in": "query", - "type": "integer", - "default": 1, + "schema": { + "type": "integer", + "default": 1 + }, "description": "paginate through conversations" } ], "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_list" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_list" + } + } } }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -3051,94 +4059,94 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "source_id", - "inbox_id" - ], - "properties": { - "source_id": { - "type": "string", - "description": "Conversation source id" - }, - "inbox_id": { - "type": "string", - "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email " - }, - "contact_id": { - "type": "string", - "description": "Contact Id for which conversation is created" - }, - "additional_attributes": { - "type": "object", - "description": "Lets you specify attributes like browser information" - }, - "custom_attributes": { - "type": "object", - "description": "The object to save custom attributes for conversation, accepts custom attributes key and value", - "example": { - "attribute_key": "attribute_value", - "priority_conversation_number": 3 - } - }, - "status": { - "type": "string", - "enum": [ - "open", - "resolved", - "pending" - ], - "description": "Specify the conversation whether it's pending, open, closed" - }, - "assignee_id": { - "type": "string", - "description": "Agent Id for assigning a conversation to an agent" - }, - "team_id": { - "type": "string", - "description": "Team Id for assigning a conversation to a team" - }, - "message": { - "type": "object", - "description": "The initial message to be sent to the conversation", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "The content of the message" - }, - "template_params": { - "type": "object", - "description": "The template params for the message in case of whatsapp Channel", - "properties": { - "name": { - "type": "string", - "description": "Name of the template", - "example": "sample_issue_resolution" - }, - "category": { - "type": "string", - "description": "Category of the template", - "example": "UTILITY" - }, - "language": { - "type": "string", - "description": "Language of the template", - "example": "en_US" - }, - "processed_params": { - "type": "object", - "description": "The processed param values for template variables in template", - "example": { - "1": "Chatwoot" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "source_id", + "inbox_id" + ], + "properties": { + "source_id": { + "type": "string", + "description": "Conversation source id" + }, + "inbox_id": { + "type": "string", + "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email " + }, + "contact_id": { + "type": "string", + "description": "Contact Id for which conversation is created" + }, + "additional_attributes": { + "type": "object", + "description": "Lets you specify attributes like browser information" + }, + "custom_attributes": { + "type": "object", + "description": "The object to save custom attributes for conversation, accepts custom attributes key and value", + "example": { + "attribute_key": "attribute_value", + "priority_conversation_number": 3 + } + }, + "status": { + "type": "string", + "enum": [ + "open", + "resolved", + "pending" + ], + "description": "Specify the conversation whether it's pending, open, closed" + }, + "assignee_id": { + "type": "string", + "description": "Agent Id for assigning a conversation to an agent" + }, + "team_id": { + "type": "string", + "description": "Team Id for assigning a conversation to a team" + }, + "message": { + "type": "object", + "description": "The initial message to be sent to the conversation", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "description": "The content of the message" + }, + "template_params": { + "type": "object", + "description": "The template params for the message in case of whatsapp Channel", + "properties": { + "name": { + "type": "string", + "description": "Name of the template", + "example": "sample_issue_resolution" + }, + "category": { + "type": "string", + "description": "Category of the template", + "example": "UTILITY" + }, + "language": { + "type": "string", + "description": "Language of the template", + "example": "en_US" + }, + "processed_params": { + "type": "object", + "description": "The processed param values for template variables in template", + "example": { + "1": "Chatwoot" + } } } } @@ -3148,30 +4156,41 @@ } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID of the conversation" - }, - "account_id": { - "type": "number", - "description": "Account Id" - }, - "inbox_id": { - "type": "number", - "description": "ID of the inbox" + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID of the conversation" + }, + "account_id": { + "type": "number", + "description": "Account Id" + }, + "inbox_id": { + "type": "number", + "description": "ID of the inbox" + } + } } } } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3179,7 +4198,7 @@ "/api/v1/accounts/{account_id}/conversations/filter": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "post": { @@ -3205,85 +4224,97 @@ { "name": "page", "in": "query", - "type": "integer" - }, - { - "name": "body", - "in": "body", - "required": true, "schema": { - "type": "object", - "properties": { - "payload": { - "type": "array", - "items": { - "type": "object", - "properties": { - "attribute_key": { - "type": "string", - "description": "filter attribute name" - }, - "filter_operator": { - "type": "string", - "description": "filter operator name", - "enum": [ - "equal_to", - "not_equal_to", - "contains", - "does_not_contain" - ] - }, - "values": { - "type": "array", - "items": { - "type": "string" + "type": "number" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "payload": { + "type": "array", + "items": { + "type": "object", + "properties": { + "attribute_key": { + "type": "string", + "description": "filter attribute name" }, - "description": "array of the attribute values to filter" - }, - "query_operator": { - "type": "string", - "description": "query operator name", - "enum": [ - "AND", - "OR" - ] + "filter_operator": { + "type": "string", + "description": "filter operator name", + "enum": [ + "equal_to", + "not_equal_to", + "contains", + "does_not_contain" + ] + }, + "values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "array of the attribute values to filter" + }, + "query_operator": { + "type": "string", + "description": "query operator name", + "enum": [ + "AND", + "OR" + ] + } } - } - }, - "example": [ - { - "attribute_key": "browser_language", - "filter_operator": "not_eq", - "values": [ - "en" - ], - "query_operator": "AND" }, - { - "attribute_key": "status", - "filter_operator": "eq", - "values": [ - "pending" - ], - "query_operator": null - } - ] + "example": [ + { + "attribute_key": "browser_language", + "filter_operator": "not_eq", + "values": [ + "en" + ], + "query_operator": "AND" + }, + { + "attribute_key": "status", + "filter_operator": "eq", + "values": [ + "pending" + ], + "query_operator": null + } + ] + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_list" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_list" + } + } } }, "400": { "description": "Bad Request Error", - "schema": { - "$ref": "#/definitions/bad_request_error" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } } } @@ -3292,10 +4323,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "get": { @@ -3308,15 +4339,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_show" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_show" + } + } + } + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "404": { - "description": "Conversation not found" - }, - "403": { - "description": "Access denied" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -3339,42 +4388,56 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "priority": { - "type": "string", - "enum": [ - "urgent", - "high", - "medium", - "low", - "none" - ], - "description": "The priority of the conversation" - }, - "sla_policy_id": { - "type": "number", - "description": "The ID of the SLA policy (Available only in Enterprise edition)" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "priority": { + "type": "string", + "enum": [ + "urgent", + "high", + "medium", + "low", + "none" + ], + "description": "The priority of the conversation" + }, + "sla_policy_id": { + "type": "number", + "description": "The ID of the SLA policy (Available only in Enterprise edition)" + } } } } } - ], + }, "responses": { "200": { "description": "Success" }, - "404": { - "description": "Conversation not found" - }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } + }, + "404": { + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3382,10 +4445,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -3407,42 +4470,60 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "status" - ], - "properties": { - "status": { - "type": "string", - "enum": [ - "open", - "resolved", - "pending" - ], - "description": "The status of the conversation" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "status" + ], + "properties": { + "status": { + "type": "string", + "enum": [ + "open", + "resolved", + "pending" + ], + "description": "The status of the conversation" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_status_toggle" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_status_toggle" + } + } } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3450,10 +4531,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_priority": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -3475,41 +4556,55 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "priority" - ], - "properties": { - "priority": { - "type": "string", - "enum": [ - "urgent", - "high", - "medium", - "low", - "none" - ], - "description": "The priority of the conversation" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "priority" + ], + "properties": { + "priority": { + "type": "string", + "enum": [ + "urgent", + "high", + "medium", + "low", + "none" + ], + "description": "The priority of the conversation" + } } } } } - ], + }, "responses": { "200": { "description": "Success" }, - "404": { - "description": "Conversation not found" - }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } + }, + "404": { + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3517,10 +4612,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/custom_attributes": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -3542,47 +4637,65 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "custom_attributes" - ], - "properties": { - "custom_attributes": { - "type": "object", - "description": "The custom attributes to be set for the conversation", - "example": { - "order_id": "12345", - "previous_conversation": "67890" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "custom_attributes" + ], + "properties": { + "custom_attributes": { + "type": "object", + "description": "The custom attributes to be set for the conversation", + "example": { + "order_id": "12345", + "previous_conversation": "67890" + } } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "properties": { - "custom_attributes": { + "content": { + "application/json": { + "schema": { "type": "object", - "description": "The custom attributes of the conversation" + "properties": { + "custom_attributes": { + "type": "object", + "description": "The custom attributes of the conversation" + } + } + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" } } } }, "404": { - "description": "Conversation not found" - }, - "401": { - "description": "Unauthorized" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3590,10 +4703,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "post": { @@ -3615,38 +4728,56 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "assignee_id": { - "type": "number", - "description": "Id of the assignee user" - }, - "team_id": { - "type": "number", - "description": "Id of the team. If the assignee_id is present, this param would be ignored" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "assignee_id": { + "type": "number", + "description": "Id of the assignee user" + }, + "team_id": { + "type": "number", + "description": "Id of the team. If the assignee_id is present, this param would be ignored" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/user" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } + } + }, + "401": { + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } } }, "404": { - "description": "Conversation not found" - }, - "401": { - "description": "Unauthorized" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3654,10 +4785,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "get": { @@ -3670,15 +4801,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_labels" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_labels" + } + } } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -3689,37 +4838,62 @@ "operationId": "conversation-add-labels", "summary": "Add Labels", "description": "Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "labels": { - "type": "array", - "description": "Array of labels (comma-separated strings)", - "items": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "labels" + ], + "properties": { + "labels": { + "type": "array", + "description": "Array of labels (comma-separated strings)", + "items": { + "type": "string" + }, + "example": [ + "support", + "billing" + ] } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/conversation_labels" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_labels" + } + } } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3734,25 +4908,43 @@ "description": "List all inboxes available in the current account", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of inboxes", - "items": { - "$ref": "#/definitions/inbox" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of inboxes", + "items": { + "$ref": "#/components/schemas/inbox" + } + } } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3767,12 +4959,14 @@ "description": "Get an inbox available in the current account", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the inbox", "required": true } @@ -3780,15 +4974,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/inbox" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inbox" + } + } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3803,71 +5015,91 @@ "description": "You can create more than one website inbox in each account", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the inbox" - }, - "avatar": { - "type": "string", - "format": "binary", - "description": "File for avatar image" - }, - "channel": { - "type": "object", - "properties": { - "type": { - "type": "string", - "enum": [ - "web_widget" - ] - }, - "website_url": { - "type": "string", - "description": "URL at which the widget will be loaded" - }, - "welcome_title": { - "type": "string", - "description": "Welcome title to be displayed on the widget" - }, - "welcome_tagline": { - "type": "string", - "description": "Welcome tagline to be displayed on the widget" - }, - "agent_away_message": { - "type": "string", - "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" - }, - "widget_color": { - "type": "string", - "description": "A Hex-color string used to customize the widget" + "$ref": "#/components/parameters/account_id" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the inbox" + }, + "avatar": { + "type": "string", + "format": "binary", + "description": "File for avatar image" + }, + "channel": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "web_widget" + ] + }, + "website_url": { + "type": "string", + "description": "URL at which the widget will be loaded" + }, + "welcome_title": { + "type": "string", + "description": "Welcome title to be displayed on the widget" + }, + "welcome_tagline": { + "type": "string", + "description": "Welcome tagline to be displayed on the widget" + }, + "agent_away_message": { + "type": "string", + "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" + }, + "widget_color": { + "type": "string", + "description": "A Hex-color string used to customize the widget" + } } } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/inbox" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inbox" + } + } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3882,79 +5114,101 @@ "description": "Add avatar and disable auto assignment for an inbox", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the inbox", "required": true - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "enable_auto_assignment" - ], - "properties": { - "name": { - "type": "string", - "description": "The name of the inbox" - }, - "enable_auto_assignment": { - "type": "boolean", - "description": "Enable Auto Assignment" - }, - "avatar": { - "type": "string", - "format": "binary", - "description": "Image file for avatar" - }, - "channel": { - "type": "object", - "properties": { - "website_url": { - "type": "string", - "description": "URL at which the widget will be loaded" - }, - "welcome_title": { - "type": "string", - "description": "Welcome title to be displayed on the widget" - }, - "welcome_tagline": { - "type": "string", - "description": "Welcome tagline to be displayed on the widget" - }, - "agent_away_message": { - "type": "string", - "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" - }, - "widget_color": { - "type": "string", - "description": "A Hex-color string used to customize the widget" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "enable_auto_assignment" + ], + "properties": { + "name": { + "type": "string", + "description": "The name of the inbox" + }, + "enable_auto_assignment": { + "type": "boolean", + "description": "Enable Auto Assignment" + }, + "avatar": { + "type": "string", + "format": "binary", + "description": "Image file for avatar" + }, + "channel": { + "type": "object", + "properties": { + "website_url": { + "type": "string", + "description": "URL at which the widget will be loaded" + }, + "welcome_title": { + "type": "string", + "description": "Welcome title to be displayed on the widget" + }, + "welcome_tagline": { + "type": "string", + "description": "Welcome tagline to be displayed on the widget" + }, + "agent_away_message": { + "type": "string", + "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" + }, + "widget_color": { + "type": "string", + "description": "A Hex-color string used to customize the widget" + } } } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/inbox" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inbox" + } + } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -3969,12 +5223,14 @@ "description": "See if an agent bot is associated to the Inbox", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the inbox", "required": true } @@ -3982,15 +5238,33 @@ "responses": { "204": { "description": "Success", - "schema": { - "$ref": "#/definitions/agent_bot" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/agent_bot" + } + } } }, "404": { - "description": "Inbox not found, Agent bot not found" + "description": "Inbox not found, Agent bot not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4005,42 +5279,60 @@ "description": "To add an agent bot pass agent_bot id, to remove agent bot from an inbox pass null", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "name": "id", "in": "path", - "type": "number", + "schema": { + "type": "number" + }, "description": "ID of the inbox", "required": true - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "agent_bot" - ], - "properties": { - "agent_bot": { - "type": "number", - "description": "Agent bot ID" + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "agent_bot" + ], + "properties": { + "agent_bot": { + "type": "number", + "description": "Agent bot ID" + } } } } } - ], + }, "responses": { "204": { "description": "Success" }, "404": { - "description": "Inbox not found, Agent bot not found" + "description": "Inbox not found, Agent bot not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4048,10 +5340,10 @@ "/api/v1/accounts/{account_id}/inbox_members/{inbox_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/inbox_id" + "$ref": "#/components/parameters/inbox_id" } ], "get": { @@ -4070,25 +5362,43 @@ ], "parameters": [ { - "$ref": "#/parameters/inbox_id" + "$ref": "#/components/parameters/inbox_id" } ], "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all active agents", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/components/schemas/agent" + } + } } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4096,7 +5406,7 @@ "/api/v1/accounts/{account_id}/inbox_members": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "post": { @@ -4113,52 +5423,77 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "inbox_id", - "user_ids" - ], - "properties": { - "inbox_id": { - "type": "string", - "description": "The ID of the inbox" - }, - "user_ids": { - "type": "array", - "items": { - "type": "integer" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "inbox_id", + "user_ids" + ], + "properties": { + "inbox_id": { + "type": "string", + "description": "The ID of the inbox" }, - "description": "IDs of users to be added to the inbox" + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the inbox" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all active agents", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/components/schemas/agent" + } + } } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4176,52 +5511,77 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "inbox_id", - "user_ids" - ], - "properties": { - "inbox_id": { - "type": "string", - "description": "The ID of the inbox" - }, - "user_ids": { - "type": "array", - "items": { - "type": "integer" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "inbox_id", + "user_ids" + ], + "properties": { + "inbox_id": { + "type": "string", + "description": "The ID of the inbox" }, - "description": "IDs of users to be added to the inbox" + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the inbox" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all active agents", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/components/schemas/agent" + } + } } } }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4239,45 +5599,66 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "inbox_id", - "user_ids" - ], - "properties": { - "inbox_id": { - "type": "string", - "description": "The ID of the inbox" - }, - "user_ids": { - "type": "array", - "items": { - "type": "integer" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "inbox_id", + "user_ids" + ], + "properties": { + "inbox_id": { + "type": "string", + "description": "The ID of the inbox" }, - "description": "IDs of users to be deleted from the inbox" + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be deleted from the inbox" + } } } } } - ], + }, "responses": { "200": { "description": "Success" }, "404": { - "description": "Inbox not found" + "description": "Inbox not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4285,10 +5666,10 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" } ], "get": { @@ -4301,26 +5682,44 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of messages", - "items": { - "allOf": [ - { - "$ref": "#/definitions/generic_id" - }, - { - "$ref": "#/definitions/message" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of messages", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/generic_id" + }, + { + "$ref": "#/components/schemas/message" + } + ] } - ] + } } } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4343,35 +5742,53 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/conversation_message_create" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/conversation_message_create" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "allOf": [ - { - "$ref": "#/definitions/generic_id" - }, - { - "$ref": "#/definitions/message" + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/generic_id" + }, + { + "$ref": "#/components/schemas/message" + } + ] } - ] + } } }, "404": { - "description": "Conversation not found" + "description": "Conversation not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4379,13 +5796,13 @@ "/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/conversation_id" + "$ref": "#/components/parameters/conversation_id" }, { - "$ref": "#/parameters/message_id" + "$ref": "#/components/parameters/message_id" } ], "delete": { @@ -4400,10 +5817,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The message or conversation does not exist in the account" + "description": "The message or conversation does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4411,7 +5842,7 @@ "/api/v1/accounts/{account_id}/integrations/apps": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -4424,19 +5855,37 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of Integration apps", - "items": { - "$ref": "#/definitions/integrations_app" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of Integration apps", + "items": { + "$ref": "#/components/schemas/integrations_app" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "Url not found" + "description": "Url not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4451,26 +5900,39 @@ "description": "Create an integration hook", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/integrations_hook_create_payload" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/integrations_hook_create_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/integrations_hook" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/integrations_hook" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4485,29 +5947,42 @@ "description": "Update an Integration Hook", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/hook_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/integrations_hook_update_payload" - } + "$ref": "#/components/parameters/hook_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/integrations_hook_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/integrations_hook" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/integrations_hook" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4520,10 +5995,10 @@ "description": "Delete an Integration Hook", "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/hook_id" + "$ref": "#/components/parameters/hook_id" } ], "responses": { @@ -4531,10 +6006,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The hook does not exist in the account" + "description": "The hook does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4550,12 +6039,23 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/user" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/user" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4563,7 +6063,7 @@ "/api/v1/accounts/{account_id}/teams": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -4576,16 +6076,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of teams", - "items": { - "$ref": "#/definitions/team" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of teams", + "items": { + "$ref": "#/components/schemas/team" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4598,26 +6109,39 @@ "description": "Create a team in the account", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/team_create_update_payload" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/team_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/team" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/team" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4625,10 +6149,10 @@ "/api/v1/accounts/{account_id}/teams/{team_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/team_id" + "$ref": "#/components/parameters/team_id" } ], "get": { @@ -4641,15 +6165,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/team" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/team" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given team ID does not exist in the account" + "description": "The given team ID does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4660,25 +6202,36 @@ "operationId": "update-a-team", "summary": "Update a team", "description": "Update a team's attributes", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/team_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/team_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/team" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/team" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4694,10 +6247,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The team does not exist in the account" + "description": "The team does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4705,10 +6272,10 @@ "/api/v1/accounts/{account_id}/teams/{team_id}/team_members": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/team_id" + "$ref": "#/components/parameters/team_id" } ], "get": { @@ -4727,28 +6294,46 @@ ], "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/team_id" + "$ref": "#/components/parameters/team_id" } ], "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all agents in the team", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all agents in the team", + "items": { + "$ref": "#/components/schemas/agent" + } + } + } + } + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } } } }, "404": { - "description": "Inbox not found" - }, - "403": { - "description": "Access denied" + "description": "Team not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4766,47 +6351,72 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "user_ids" - ], - "properties": { - "user_ids": { - "type": "array", - "items": { - "type": "integer" - }, - "description": "IDs of users to be added to the team" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the team" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all active agents", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all active agents", + "items": { + "$ref": "#/components/schemas/agent" + } + } + } + } + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } } } }, "404": { - "description": "Team not found" - }, - "403": { - "description": "Access denied" + "description": "Team not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4824,47 +6434,72 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "user_ids" - ], - "properties": { - "user_ids": { - "type": "array", - "items": { - "type": "integer" - }, - "description": "IDs of users to be added to the team" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be added to the team" + } } } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of all agents in the team", - "items": { - "$ref": "#/definitions/agent" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of all agents in the team", + "items": { + "$ref": "#/components/schemas/agent" + } + } + } + } + }, + "403": { + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } } } }, "404": { - "description": "Team not found" - }, - "403": { - "description": "Access denied" + "description": "Team not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4882,41 +6517,61 @@ ] } ], - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "required": [ - "team_id", - "user_ids" - ], - "properties": { - "user_ids": { - "type": "array", - "items": { - "type": "integer" - }, - "description": "IDs of users to be deleted from the team" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "user_ids" + ], + "properties": { + "user_ids": { + "type": "array", + "items": { + "type": "integer" + }, + "description": "IDs of users to be deleted from the team" + } } } } } - ], + }, "responses": { "200": { "description": "Success" }, - "404": { - "description": "Team not found" - }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } + }, + "404": { + "description": "Team not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "422": { - "description": "User must exist" + "description": "User must exist", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4924,17 +6579,19 @@ "/api/v1/accounts/{account_id}/custom_filters": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "in": "query", "name": "filter_type", - "type": "string", - "enum": [ - "conversation", - "contact", - "report" - ], + "schema": { + "type": "string", + "enum": [ + "conversation", + "contact", + "report" + ] + }, "required": false, "description": "The type of custom filter" } @@ -4949,16 +6606,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of custom filters", - "items": { - "$ref": "#/definitions/custom_filter" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of custom filters", + "items": { + "$ref": "#/components/schemas/custom_filter" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -4971,26 +6639,39 @@ "description": "Create a custom filter in the account", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/custom_filter_create_update_payload" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_filter_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_filter" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_filter" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -4998,10 +6679,10 @@ "/api/v1/accounts/{account_id}/custom_filters/{custom_filter_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/custom_filter_id" + "$ref": "#/components/parameters/custom_filter_id" } ], "get": { @@ -5014,15 +6695,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_filter" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_filter" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The given team ID does not exist in the account" + "description": "The given team ID does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -5033,25 +6732,36 @@ "operationId": "update-a-custom-filter", "summary": "Update a custom filter", "description": "Update a custom filter's attributes", - "parameters": [ - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/custom_filter_create_update_payload" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_filter_create_update_payload" + } } } - ], + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/custom_filter" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/custom_filter" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -5067,10 +6777,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "404": { - "description": "The custom filter does not exist in the account" + "description": "The custom filter does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5078,7 +6802,7 @@ "/api/v1/accounts/{account_id}/webhooks": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" } ], "get": { @@ -5091,16 +6815,27 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of webhook objects", - "items": { - "$ref": "#/definitions/webhook" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of webhook objects", + "items": { + "$ref": "#/components/schemas/webhook" + } + } } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -5113,26 +6848,39 @@ "description": "Add a webhook subscription to the account", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/webhook_create_update_payload" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhook_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/webhook" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhook" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5140,10 +6888,10 @@ "/api/v1/accounts/{account_id}/webhooks/{webhook_id}": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/webhook_id" + "$ref": "#/components/parameters/webhook_id" } ], "patch": { @@ -5155,26 +6903,39 @@ "description": "Update a webhook object in the account", "parameters": [ { - "$ref": "#/parameters/account_id" - }, - { - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/webhook_create_update_payload" - } + "$ref": "#/components/parameters/account_id" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhook_create_update_payload" + } + } + } + }, "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/webhook" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/webhook" + } + } } }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } }, @@ -5190,10 +6951,24 @@ "description": "Success" }, "401": { - "description": "Unauthorized" + "description": "Unauthorized", + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } }, "404": { - "description": "The webhook does not exist in the account" + "description": "The webhook does not exist in the account", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5201,30 +6976,36 @@ "/api/v2/accounts/{account_id}/reports": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/report_metric" + "$ref": "#/components/parameters/report_metric" }, { - "$ref": "#/parameters/report_type" + "$ref": "#/components/parameters/report_type" }, { "in": "query", "name": "id", - "type": "string", + "schema": { + "type": "string" + }, "description": "The Id of specific object in case of agent/inbox/label" }, { "in": "query", "name": "since", - "type": "string", + "schema": { + "type": "string" + }, "description": "The timestamp from where report should start." }, { "in": "query", "name": "until", - "type": "string", + "schema": { + "type": "string" + }, "description": "The timestamp from where report should stop." } ], @@ -5238,27 +7019,45 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of date based conversation statistics", - "items": { - "type": "object", - "properties": { - "value": { - "type": "string" - }, - "timestamp": { - "type": "number" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of date based conversation statistics", + "items": { + "type": "object", + "properties": { + "value": { + "type": "string" + }, + "timestamp": { + "type": "number" + } + } } } } } }, "404": { - "description": "reports not found" + "description": "reports not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5266,27 +7065,33 @@ "/api/v2/accounts/{account_id}/reports/summary": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { - "$ref": "#/parameters/report_type" + "$ref": "#/components/parameters/report_type" }, { "in": "query", "name": "id", - "type": "string", + "schema": { + "type": "string" + }, "description": "The Id of specific object in case of agent/inbox/label" }, { "in": "query", "name": "since", - "type": "string", + "schema": { + "type": "string" + }, "description": "The timestamp from where report should start." }, { "in": "query", "name": "until", - "type": "string", + "schema": { + "type": "string" + }, "description": "The timestamp from where report should stop." } ], @@ -5300,15 +7105,33 @@ "responses": { "200": { "description": "Success", - "schema": { - "$ref": "#/definitions/account_summary" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/account_summary" + } + } } }, "404": { - "description": "reports not found" + "description": "reports not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5316,15 +7139,17 @@ "/api/v2/accounts/{account_id}/reports/conversations": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "in": "query", "name": "type", - "type": "string", - "enum": [ - "account" - ], + "schema": { + "type": "string", + "enum": [ + "account" + ] + }, "required": true, "description": "Type of report" } @@ -5339,27 +7164,45 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "object", - "description": "Object of account conversation metrics", - "properties": { - "open": { - "type": "number" - }, - "unattended": { - "type": "number" - }, - "unassigned": { - "type": "number" + "content": { + "application/json": { + "schema": { + "type": "object", + "description": "Object of account conversation metrics", + "properties": { + "open": { + "type": "number" + }, + "unattended": { + "type": "number" + }, + "unassigned": { + "type": "number" + } + } } } } }, "404": { - "description": "reports not found" + "description": "reports not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } } } } @@ -5367,22 +7210,26 @@ "/api/v2/accounts/{account_id}/reports/conversations/": { "parameters": [ { - "$ref": "#/parameters/account_id" + "$ref": "#/components/parameters/account_id" }, { "in": "query", "name": "type", - "type": "string", - "enum": [ - "agent" - ], + "schema": { + "type": "string", + "enum": [ + "agent" + ] + }, "required": true, "description": "Type of report" }, { "in": "query", "name": "user_id", - "type": "string", + "schema": { + "type": "string" + }, "description": "The numeric ID of the user" } ], @@ -5396,1714 +7243,1871 @@ "responses": { "200": { "description": "Success", - "schema": { - "type": "array", - "description": "Array of agent based conversation metrics", - "items": { - "$ref": "#/definitions/agent_conversation_metrics" + "content": { + "application/json": { + "schema": { + "type": "array", + "description": "Array of agent based conversation metrics", + "items": { + "$ref": "#/components/schemas/agent_conversation_metrics" + } + } } } }, "404": { - "description": "reports not found" + "description": "reports not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" + } + } + } }, "403": { - "description": "Access denied" - } - } - } - } - }, - "definitions": { - "bad_request_error": { - "title": "data", - "type": "object", - "properties": { - "description": { - "type": "string" - }, - "errors": { - "type": "array", - "items": { - "$ref": "#/definitions/request_error" - } - } - } - }, - "request_error": { - "type": "object", - "properties": { - "field": { - "type": "string" - }, - "message": { - "type": "string" - }, - "code": { - "type": "string" - } - } - }, - "generic_id": { - "type": "object", - "properties": { - "id": { - "type": "number" - } - } - }, - "canned_response": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "ID of the canned response" - }, - "content": { - "type": "string", - "description": "Message content for canned response" - }, - "short_code": { - "type": "string", - "description": "Short Code for quick access of the canned response" - }, - "account_id": { - "type": "integer", - "description": "Account Id" - } - } - }, - "custom_attribute": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Identifier" - }, - "attribute_display_name": { - "type": "string", - "description": "Attribute display name" - }, - "attribute_display_type": { - "type": "string", - "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)" - }, - "attribute_description": { - "type": "string", - "description": "Attribute description" - }, - "attribute_key": { - "type": "string", - "description": "Attribute unique key value" - }, - "attribute_values": { - "type": "string", - "description": "Attribute values" - }, - "default_value": { - "type": "string", - "description": "Attribute default value" - }, - "attribute_model": { - "type": "string", - "description": "Attribute type(conversation_attribute/contact_attribute)" - }, - "account_id": { - "type": "integer", - "description": "Account Id" - } - } - }, - "automation_rule": { - "type": "object", - "properties": { - "event_name": { - "type": "string", - "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)", - "enum": [ - "conversation_created", - "conversation_updated", - "message_created" - ], - "example": "message_created" - }, - "name": { - "type": "string", - "description": "The name of the rule", - "example": "Add label on message create event" - }, - "description": { - "type": "string", - "description": "Description to give more context about the rule", - "example": "Add label support and sales on message create event if incoming message content contains text help" - }, - "active": { - "type": "boolean", - "description": "Enable/disable automation rule" - }, - "actions": { - "type": "array", - "description": "Array of actions which we perform when condition matches", - "items": { - "type": "object", - "example": { - "action_name": "add_label", - "action_params": [ - "support", - "sales" - ] - } - } - }, - "conditions": { - "type": "array", - "description": "Array of conditions on which conversation/message filter would work", - "items": { - "type": "object", - "example": { - "attribute_key": "content", - "filter_operator": "contains", - "values": [ - "help" - ], - "query_operator": "nil" - } - } - }, - "account_id": { - "type": "integer", - "description": "Account Id" - } - } - }, - "portal": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "archived": { - "type": "boolean" - }, - "color": { - "type": "string" - }, - "config": { - "type": "object", - "description": "Save information about locales, allowed_locales and default portal/help-center locale" - }, - "custom_domain": { - "type": "string" - }, - "header_text": { - "type": "string", - "description": "The text content." - }, - "homepage_link": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "page_title": { - "type": "string" - }, - "account_id": { - "type": "integer" - }, - "categories": { - "type": "array", - "items": { - "$ref": "#/definitions/category" - } - }, - "articles": { - "type": "array", - "items": { - "$ref": "#/definitions/article" - } - } - } - }, - "category": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "description": { - "type": "string", - "description": "The text content." - }, - "locale": { - "type": "string" - }, - "name": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "position": { - "type": "integer" - }, - "portal_id": { - "type": "integer" - }, - "account_id": { - "type": "integer" - }, - "associated_category_id": { - "type": "integer", - "description": "To associate similar categories to each other, e.g same category of product documentation in different languages" - }, - "parent_category_id": { - "type": "integer", - "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category." - } - } - }, - "article": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "content": { - "type": "string", - "description": "The text content." - }, - "meta": { - "type": "object" - }, - "position": { - "type": "integer" - }, - "status": { - "type": "integer", - "enum": [ - "draft", - "published", - "archived" - ] - }, - "title": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "views": { - "type": "integer" - }, - "portal_id": { - "type": "integer" - }, - "account_id": { - "type": "integer" - }, - "author_id": { - "type": "integer" - }, - "category_id": { - "type": "integer" - }, - "folder_id": { - "type": "integer" - }, - "associated_article_id": { - "type": "integer", - "description": "To associate similar articles to each other, e.g to provide the link for the reference." - } - } - }, - "contact": { - "type": "object", - "properties": { - "payload": { - "type": "object", - "properties": { - "contact": { - "type": "object", - "properties": { - "email": { - "type": "string", - "description": "Email address of the contact" - }, - "name": { - "type": "string", - "description": "The name of the contact" - }, - "phone_number": { - "type": "string", - "description": "Phone number of the contact" - }, - "thumbnail": { - "type": "string", - "description": "Avatar URL of the contact" - }, - "additional_attributes": { - "type": "object", - "description": "The object containing additional attributes related to the contact" - }, - "custom_attributes": { - "type": "object", - "description": "The object to save custom attributes for contact, accepts custom attributes key and value", - "example": { - "attribute_key": "attribute_value", - "signed_up_at": "dd/mm/yyyy" - } - }, - "contact_inboxes": { - "type": "array", - "items": { - "$ref": "#/definitions/contact_inboxes" - } + "description": "Access denied", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/bad_request_error" } } } } } } - }, - "conversation": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID of the conversation" - }, - "messages": { - "type": "array", - "items": { - "$ref": "#/definitions/message" - } - }, - "account_id": { - "type": "number", - "description": "Account Id" - }, - "inbox_id": { - "type": "number", - "description": "ID of the inbox" - }, - "status": { - "type": "string", - "enum": [ - "open", - "resolved", - "pending" - ], - "description": "The status of the conversation" - }, - "timestamp": { - "type": "string", - "description": "The time at which conversation was created" - }, - "contact_last_seen_at": { - "type": "string" - }, - "agent_last_seen_at": { - "type": "string" - }, - "unread_count": { - "type": "number", - "description": "The number of unread messages" - }, - "additional_attributes": { - "type": "object", - "description": "The object containing additional attributes related to the conversation" - }, - "custom_attributes": { - "type": "object", - "description": "The object to save custom attributes for conversation, accepts custom attributes key and value", - "example": { - "attribute_key": "attribute_value", - "priority_conversation_number": 3 - } - } - } - }, - "message": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "The text content of the message" - }, - "content_type": { - "type": "string", - "enum": [ - "text", - "input_select", - "cards", - "form" - ], - "description": "The type of the template message" - }, - "content_attributes": { - "type": "object", - "description": "The content attributes for each content_type" - }, - "message_type": { - "type": "string", - "enum": [ - "incoming", - "outgoing", - "activity", - "template" - ], - "description": "The type of the message" - }, - "created_at": { - "type": "integer", - "description": "The time at which message was created" - }, - "private": { - "type": "boolean", - "description": "The flags which shows whether the message is private or not" - }, - "attachment": { - "type": "object", - "description": "The file object attached to the image" - }, - "sender": { - "type": "object", - "description": "User/Agent/AgentBot object" - }, - "conversation_id": { - "type": "number", - "description": "ID of the conversation" - } - } - }, - "user": { - "type": "object", - "properties": { - "id": { - "type": "number" - }, - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "available_name": { - "type": "string" - }, - "display_name": { - "type": "string" - }, - "email": { - "type": "string" - }, - "account_id": { - "type": "number" - }, - "role": { - "type": "string", - "enum": [ - "agent", - "administrator" - ] - }, - "confirmed": { - "type": "boolean" - }, - "custom_attributes": { - "type": "object", - "description": "Available for users who are created through platform APIs and has custom attributes associated." - }, - "accounts": { - "type": "array", - "items": { - "$ref": "#/definitions/account" - } - } - } - }, - "agent": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "uid": { - "type": "string" - }, - "name": { - "type": "string" - }, - "available_name": { - "type": "string" - }, - "display_name": { - "type": "string" - }, - "email": { - "type": "string" - }, - "account_id": { - "type": "integer" - }, - "role": { - "type": "string", - "enum": [ - "agent", - "administrator" - ] - }, - "confirmed": { - "type": "boolean" - }, - "availability_status": { - "type": "string", - "enum": [ - "available", - "busy", - "offline" - ], - "description": "The availability status of the agent computed by Chatwoot." - }, - "auto_offline": { - "type": "boolean", - "description": "Whether the availability status of agent is configured to go offline automatically when away." - }, - "custom_attributes": { - "type": "object", - "description": "Available for users who are created through platform APIs and has custom attributes associated." - } - } - }, - "inbox": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID of the inbox" - }, - "name": { - "type": "string", - "description": "The name of the inbox" - }, - "website_url": { - "type": "string", - "description": "Website URL" - }, - "channel_type": { - "type": "string", - "description": "The type of the inbox" - }, - "avatar_url": { - "type": "string", - "description": "The avatar image of the inbox" - }, - "widget_color": { - "type": "string", - "description": "Widget Color used for customization of the widget" - }, - "website_token": { - "type": "string", - "description": "Website Token" - }, - "enable_auto_assignment": { - "type": "boolean", - "description": "The flag which shows whether Auto Assignment is enabled or not" - }, - "web_widget_script": { - "type": "string", - "description": "Script used to load the website widget" - }, - "welcome_title": { - "type": "string", - "description": "Welcome title to be displayed on the widget" - }, - "welcome_tagline": { - "type": "string", - "description": "Welcome tagline to be displayed on the widget" - }, - "greeting_enabled": { - "type": "boolean", - "description": "The flag which shows whether greeting is enabled" - }, - "greeting_message": { - "type": "string", - "description": "A greeting message when the user starts the conversation" - } - } - }, - "agent_bot": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID of the agent bot" - }, - "name": { - "type": "string", - "description": "The name of the agent bot" - }, - "description": { - "type": "string", - "description": "The description about the agent bot" - }, - "account_id": { - "type": "number", - "description": "Account ID if it's an account specific bot" - }, - "outgoing_url": { - "type": "string", - "description": "The webhook URL for the bot" - } - } - }, - "contact_inboxes": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - }, - "inbox": { - "$ref": "#/definitions/inbox" - } - } - }, - "contactable_inboxes": { - "type": "object", - "properties": { - "source_id": { - "type": "string", - "description": "Contact Inbox Source Id" - }, - "inbox": { - "$ref": "#/definitions/inbox" - } - } - }, - "custom_filter": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "The ID of the custom filter" - }, - "name": { - "type": "string", - "description": "The name of the custom filter" - }, - "type": { - "type": "string", - "enum": [ - "conversation", - "contact", - "report" - ], - "description": "The description about the custom filter" - }, - "query": { - "type": "object", - "description": "A query that needs to be saved as a custom filter" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the custom filter was created" - }, - "updated_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the custom filter was updated" - } - } - }, - "webhook": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "The ID of the webhook" - }, - "url": { - "type": "string", - "description": "The url to which the events will be send" - }, - "subscriptions": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "conversation_created", - "conversation_status_changed", - "conversation_updated", - "contact_created", - "contact_updated", - "message_created", - "message_updated", - "webwidget_triggered" - ] + } + }, + "components": { + "schemas": { + "bad_request_error": { + "title": "data", + "type": "object", + "properties": { + "description": { + "type": "string" }, - "description": "The list of subscribed events" - }, - "account_id": { - "type": "number", - "description": "The id of the account which the webhook object belongs to" - } - } - }, - "account": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "Account ID" - }, - "name": { - "type": "string", - "description": "Name of the account" - }, - "role": { - "type": "string", - "enum": [ - "administrator", - "agent" - ], - "description": "The user role in the account" - } - } - }, - "platform_account": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "Account ID" - }, - "name": { - "type": "string", - "description": "Name of the account" - } - } - }, - "team": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "The ID of the team" - }, - "name": { - "type": "string", - "description": "The name of the team" - }, - "description": { - "type": "string", - "description": "The description about the team" - }, - "allow_auto_assign": { - "type": "boolean", - "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" - }, - "account_id": { - "type": "number", - "description": "The ID of the account with the team is a part of" - }, - "is_member": { - "type": "boolean", - "description": "This field shows whether the current user is a part of the team" - } - } - }, - "integrations_app": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the integration" - }, - "name": { - "type": "string", - "description": "The name of the integration" - }, - "description": { - "type": "string", - "description": "The description about the team" - }, - "hook_type": { - "type": "string", - "description": "Whether the integration is an account or inbox integration" - }, - "enabled": { - "type": "boolean", - "description": "Whether the integration is enabled for the account" - }, - "allow_multiple_hooks": { - "type": "boolean", - "description": "Whether multiple hooks can be created for the integration" - }, - "hooks": { - "type": "array", - "items": { - "type": "object" - }, - "description": "If there are any hooks created for this integration" - } - } - }, - "integrations_hook": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "The ID of the integration hook" - }, - "app_id": { - "type": "string", - "description": "The ID of the integration app" - }, - "inbox_id": { - "type": "string", - "description": "Inbox ID if its an Inbox integration" - }, - "account_id": { - "type": "string", - "description": "Account ID of the integration" - }, - "status": { - "type": "boolean", - "description": "Whether the integration hook is enabled for the account" - }, - "hook_type": { - "type": "boolean", - "description": "Whether its an account or inbox integration hook" - }, - "settings": { - "type": "object", - "description": "The associated settings for the integration" - } - } - }, - "public_contact": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of the contact" - }, - "source_id": { - "type": "string", - "description": "The session identifier of the contact" - }, - "name": { - "type": "string", - "description": "Name of the contact" - }, - "email": { - "type": "string", - "description": "Email of the contact" - }, - "pubsub_token": { - "type": "string", - "description": "The token to be used to connect to chatwoot websocket" - } - } - }, - "public_conversation": { - "type": "object", - "properties": { - "id": { - "type": "integer", - "description": "Id of the conversation" - }, - "inbox_id": { - "type": "string", - "description": "The inbox id of the conversation" - }, - "messages": { - "type": "array", - "items": { - "$ref": "#/definitions/message" - }, - "description": "Messages in the conversation" - }, - "contact": { - "type": "object", - "description": "The contact information associated to the conversation" - } - } - }, - "public_message": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "Id of the message" - }, - "content": { - "type": "string", - "description": "Text content of the message" - }, - "message_type": { - "type": "string", - "description": "Denotes the message type" - }, - "content_type": { - "type": "string", - "description": "Content type of the message" - }, - "content_attributes": { - "type": "string", - "description": "Additional content attributes of the message" - }, - "created_at": { - "type": "string", - "description": "Created at time stamp of the message" - }, - "conversation_id": { - "type": "string", - "description": "Conversation Id of the message" - }, - "attachments": { - "type": "array", - "items": { - "type": "object" - }, - "description": "Attachments if any" - }, - "sender": { - "type": "object", - "description": "Details of the sender" - } - } - }, - "public_inbox": { - "type": "object", - "properties": { - "identifier": { - "type": "string", - "description": "Inbox identifier" - }, - "name": { - "type": "string", - "description": "Name of the inbox" - }, - "timezone": { - "type": "string", - "description": "The timezone defined on the inbox" - }, - "working_hours": { - "type": "array", - "description": "The working hours defined on the inbox", - "items": { - "type": "object", - "properties": { - "day_of_week": { - "type": "integer", - "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6" - }, - "open_all_day": { - "type": "boolean", - "description": "Whether or not the business is open the whole day" - }, - "closed_all_day": { - "type": "boolean", - "description": "Whether or not the business is closed the whole day" - }, - "open_hour": { - "type": "integer", - "description": "Opening hour. Can be null if closed all day" - }, - "open_minutes": { - "type": "integer", - "description": "Opening minute. Can be null if closed all day" - }, - "close_hour": { - "type": "integer", - "description": "Closing hour. Can be null if closed all day" - }, - "close_minutes": { - "type": "integer", - "description": "Closing minute. Can be null if closed all day" - } + "errors": { + "type": "array", + "items": { + "$ref": "#/components/schemas/request_error" } } - }, - "working_hours_enabled": { - "type": "boolean", - "description": "Whether of not the working hours are enabled on the inbox" - }, - "csat_survey_enabled": { - "type": "boolean", - "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox" - }, - "greeting_enabled": { - "type": "boolean", - "description": "Whether of not the Greeting Message is enabled on the inbox" - }, - "identity_validation_enabled": { - "type": "boolean", - "description": "Whether of not the User Identity Validation is enforced on the inbox" } - } - }, - "account_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the account" - } - } - }, - "agent_bot_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the agent bot" - }, - "description": { - "type": "string", - "description": "The description about the agent bot" - }, - "outgoing_url": { - "type": "string", - "description": "The webhook URL for the bot" - } - } - }, - "user_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Name of the user" - }, - "email": { - "type": "string", - "description": "Email of the user" - }, - "password": { - "type": "string", - "description": "Password must contain uppercase, lowercase letters, number and a special character" - }, - "custom_attributes": { - "type": "object", - "description": "Custom attributes you want to associate with the user" - } - } - }, - "canned_response_create_update_payload": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "Message content for canned response" - }, - "short_code": { - "type": "string", - "description": "Short Code for quick access of the canned response" - } - } - }, - "custom_attribute_create_update_payload": { - "type": "object", - "properties": { - "attribute_display_name": { - "type": "string", - "description": "Attribute display name" - }, - "attribute_display_type": { - "type": "integer", - "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)" - }, - "attribute_description": { - "type": "string", - "description": "Attribute description" - }, - "attribute_key": { - "type": "string", - "description": "Attribute unique key value" - }, - "attribute_values": { - "type": "array", - "description": "Attribute values", - "items": { + }, + "request_error": { + "type": "object", + "properties": { + "field": { + "type": "string" + }, + "message": { + "type": "string" + }, + "code": { "type": "string" } - }, - "attribute_model": { - "type": "integer", - "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)" } - } - }, - "contact_create": { - "type": "object", - "required": [ - "inbox_id" - ], - "properties": { - "inbox_id": { - "type": "number" - }, - "name": { - "type": "string", - "description": "name of the contact" - }, - "email": { - "type": "string", - "description": "email of the contact" - }, - "phone_number": { - "type": "string", - "description": "phone number of the contact" - }, - "avatar": { - "type": "string", - "format": "binary", - "description": "Send the form data with the avatar image binary or use the avatar_url" - }, - "avatar_url": { - "type": "string", - "description": "The url to a jpeg, png file for the contact avatar" - }, - "identifier": { - "type": "string", - "description": "A unique identifier for the contact in external system" - }, - "custom_attributes": { - "type": "object", - "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}" + }, + "generic_id": { + "type": "object", + "properties": { + "id": { + "type": "number" + } } - } - }, - "contact_update": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "name of the contact" - }, - "email": { - "type": "string", - "description": "email of the contact" - }, - "phone_number": { - "type": "string", - "description": "phone number of the contact" - }, - "avatar": { - "type": "string", - "format": "binary", - "description": "Send the form data with the avatar image binary or use the avatar_url" - }, - "avatar_url": { - "type": "string", - "description": "The url to a jpeg, png file for the contact avatar" - }, - "identifier": { - "type": "string", - "description": "A unique identifier for the contact in external system" - }, - "custom_attributes": { - "type": "object", - "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}" + }, + "canned_response": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "ID of the canned response" + }, + "content": { + "type": "string", + "description": "Message content for canned response" + }, + "short_code": { + "type": "string", + "description": "Short Code for quick access of the canned response" + }, + "account_id": { + "type": "integer", + "description": "Account Id" + } } - } - }, - "conversation_message_create": { - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "description": "The content of the message" - }, - "message_type": { - "type": "string", - "enum": [ - "outgoing", - "incoming" - ] - }, - "private": { - "type": "boolean", - "description": "Flag to identify if it is a private note" - }, - "content_type": { - "type": "string", - "enum": [ - "text", - "input_email", - "cards", - "input_select", - "form", - "article" - ], - "example": "cards", - "description": "if you want to create custom message types" - }, - "content_attributes": { - "type": "object", - "description": "attributes based on your content type" - }, - "template_params": { - "type": "object", - "description": "The template params for the message in case of whatsapp Channel", - "properties": { - "name": { - "type": "string", - "description": "Name of the template", - "example": "sample_issue_resolution" - }, - "category": { - "type": "string", - "description": "Category of the template", - "example": "UTILITY" - }, - "language": { - "type": "string", - "description": "Language of the template", - "example": "en_US" - }, - "processed_params": { + }, + "custom_attribute": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Identifier" + }, + "attribute_display_name": { + "type": "string", + "description": "Attribute display name" + }, + "attribute_display_type": { + "type": "string", + "description": "Attribute display type (text, number, currency, percent, link, date, list, checkbox)" + }, + "attribute_description": { + "type": "string", + "description": "Attribute description" + }, + "attribute_key": { + "type": "string", + "description": "Attribute unique key value" + }, + "attribute_values": { + "type": "string", + "description": "Attribute values" + }, + "default_value": { + "type": "string", + "description": "Attribute default value" + }, + "attribute_model": { + "type": "string", + "description": "Attribute type(conversation_attribute/contact_attribute)" + }, + "account_id": { + "type": "integer", + "description": "Account Id" + } + } + }, + "automation_rule": { + "type": "object", + "properties": { + "event_name": { + "type": "string", + "description": "Automation Rule event, on which we call the actions(conversation_created, conversation_updated, message_created)", + "enum": [ + "conversation_created", + "conversation_updated", + "message_created" + ], + "example": "message_created" + }, + "name": { + "type": "string", + "description": "The name of the rule", + "example": "Add label on message create event" + }, + "description": { + "type": "string", + "description": "Description to give more context about the rule", + "example": "Add label support and sales on message create event if incoming message content contains text help" + }, + "active": { + "type": "boolean", + "description": "Enable/disable automation rule" + }, + "actions": { + "type": "array", + "description": "Array of actions which we perform when condition matches", + "items": { "type": "object", - "description": "The processed param values for template variables in template", "example": { - "1": "Chatwoot" + "action_name": "add_label", + "action_params": [ + "support", + "sales" + ] + } + } + }, + "conditions": { + "type": "array", + "description": "Array of conditions on which conversation/message filter would work", + "items": { + "type": "object", + "example": { + "attribute_key": "content", + "filter_operator": "contains", + "values": [ + "help" + ], + "query_operator": "nil" + } + } + }, + "account_id": { + "type": "integer", + "description": "Account Id" + } + } + }, + "portal": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "archived": { + "type": "boolean" + }, + "color": { + "type": "string" + }, + "config": { + "type": "object", + "description": "Save information about locales, allowed_locales and default portal/help-center locale" + }, + "custom_domain": { + "type": "string" + }, + "header_text": { + "type": "string", + "description": "The text content." + }, + "homepage_link": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "page_title": { + "type": "string" + }, + "account_id": { + "type": "integer" + }, + "categories": { + "type": "array", + "items": { + "$ref": "#/components/schemas/category" + } + }, + "articles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/article" + } + } + } + }, + "category": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "description": { + "type": "string", + "description": "The text content." + }, + "locale": { + "type": "string" + }, + "name": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "position": { + "type": "integer" + }, + "portal_id": { + "type": "integer" + }, + "account_id": { + "type": "integer" + }, + "associated_category_id": { + "type": "integer", + "description": "To associate similar categories to each other, e.g same category of product documentation in different languages" + }, + "parent_category_id": { + "type": "integer", + "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category." + } + } + }, + "article": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "content": { + "type": "string", + "description": "The text content." + }, + "meta": { + "type": "object" + }, + "position": { + "type": "integer" + }, + "status": { + "type": "integer", + "enum": [ + "draft", + "published", + "archived" + ] + }, + "title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "views": { + "type": "integer" + }, + "portal_id": { + "type": "integer" + }, + "account_id": { + "type": "integer" + }, + "author_id": { + "type": "integer" + }, + "category_id": { + "type": "integer" + }, + "folder_id": { + "type": "integer" + }, + "associated_article_id": { + "type": "integer", + "description": "To associate similar articles to each other, e.g to provide the link for the reference." + } + } + }, + "contact": { + "type": "object", + "properties": { + "payload": { + "type": "object", + "properties": { + "contact": { + "type": "object", + "properties": { + "email": { + "type": "string", + "description": "Email address of the contact" + }, + "name": { + "type": "string", + "description": "The name of the contact" + }, + "phone_number": { + "type": "string", + "description": "Phone number of the contact" + }, + "thumbnail": { + "type": "string", + "description": "Avatar URL of the contact" + }, + "additional_attributes": { + "type": "object", + "description": "The object containing additional attributes related to the contact" + }, + "custom_attributes": { + "type": "object", + "description": "The object to save custom attributes for contact, accepts custom attributes key and value", + "example": { + "attribute_key": "attribute_value", + "signed_up_at": "dd/mm/yyyy" + } + }, + "contact_inboxes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/contact_inboxes" + } + } + } } } } } - } - }, - "team_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the team" - }, - "description": { - "type": "string", - "description": "The description of the team" - }, - "allow_auto_assign": { - "type": "boolean", - "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" + }, + "conversation": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID of the conversation" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/message" + } + }, + "account_id": { + "type": "number", + "description": "Account Id" + }, + "inbox_id": { + "type": "number", + "description": "ID of the inbox" + }, + "status": { + "type": "string", + "enum": [ + "open", + "resolved", + "pending" + ], + "description": "The status of the conversation" + }, + "timestamp": { + "type": "string", + "description": "The time at which conversation was created" + }, + "contact_last_seen_at": { + "type": "string" + }, + "agent_last_seen_at": { + "type": "string" + }, + "unread_count": { + "type": "number", + "description": "The number of unread messages" + }, + "additional_attributes": { + "type": "object", + "description": "The object containing additional attributes related to the conversation" + }, + "custom_attributes": { + "type": "object", + "description": "The object to save custom attributes for conversation, accepts custom attributes key and value", + "example": { + "attribute_key": "attribute_value", + "priority_conversation_number": 3 + } + } } - } - }, - "custom_filter_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "The name of the custom filter" - }, - "type": { - "type": "string", - "enum": [ - "conversation", - "contact", - "report" - ], - "description": "The description about the custom filter" - }, - "query": { - "type": "object", - "description": "A query that needs to be saved as a custom filter" + }, + "message": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The text content of the message" + }, + "content_type": { + "type": "string", + "enum": [ + "text", + "input_select", + "cards", + "form" + ], + "description": "The type of the template message" + }, + "content_attributes": { + "type": "object", + "description": "The content attributes for each content_type" + }, + "message_type": { + "type": "string", + "enum": [ + "incoming", + "outgoing", + "activity", + "template" + ], + "description": "The type of the message" + }, + "created_at": { + "type": "integer", + "description": "The time at which message was created" + }, + "private": { + "type": "boolean", + "description": "The flags which shows whether the message is private or not" + }, + "attachment": { + "type": "object", + "description": "The file object attached to the image" + }, + "sender": { + "type": "object", + "description": "User/Agent/AgentBot object" + }, + "conversation_id": { + "type": "number", + "description": "ID of the conversation" + } } - } - }, - "webhook_create_update_payload": { - "type": "object", - "properties": { - "url": { - "type": "string", - "description": "The url where the events should be sent" - }, - "subscriptions": { - "type": "array", - "items": { + }, + "user": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "available_name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "account_id": { + "type": "number" + }, + "role": { + "type": "string", + "enum": [ + "agent", + "administrator" + ] + }, + "confirmed": { + "type": "boolean" + }, + "custom_attributes": { + "type": "object", + "description": "Available for users who are created through platform APIs and has custom attributes associated." + }, + "accounts": { + "type": "array", + "items": { + "$ref": "#/components/schemas/account" + } + } + } + }, + "agent": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "uid": { + "type": "string" + }, + "name": { + "type": "string" + }, + "available_name": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "account_id": { + "type": "integer" + }, + "role": { + "type": "string", + "enum": [ + "agent", + "administrator" + ] + }, + "confirmed": { + "type": "boolean" + }, + "availability_status": { + "type": "string", + "enum": [ + "available", + "busy", + "offline" + ], + "description": "The availability status of the agent computed by Chatwoot." + }, + "auto_offline": { + "type": "boolean", + "description": "Whether the availability status of agent is configured to go offline automatically when away." + }, + "custom_attributes": { + "type": "object", + "description": "Available for users who are created through platform APIs and has custom attributes associated." + } + } + }, + "inbox": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID of the inbox" + }, + "name": { + "type": "string", + "description": "The name of the inbox" + }, + "website_url": { + "type": "string", + "description": "Website URL" + }, + "channel_type": { + "type": "string", + "description": "The type of the inbox" + }, + "avatar_url": { + "type": "string", + "description": "The avatar image of the inbox" + }, + "widget_color": { + "type": "string", + "description": "Widget Color used for customization of the widget" + }, + "website_token": { + "type": "string", + "description": "Website Token" + }, + "enable_auto_assignment": { + "type": "boolean", + "description": "The flag which shows whether Auto Assignment is enabled or not" + }, + "web_widget_script": { + "type": "string", + "description": "Script used to load the website widget" + }, + "welcome_title": { + "type": "string", + "description": "Welcome title to be displayed on the widget" + }, + "welcome_tagline": { + "type": "string", + "description": "Welcome tagline to be displayed on the widget" + }, + "greeting_enabled": { + "type": "boolean", + "description": "The flag which shows whether greeting is enabled" + }, + "greeting_message": { + "type": "string", + "description": "A greeting message when the user starts the conversation" + } + } + }, + "agent_bot": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID of the agent bot" + }, + "name": { + "type": "string", + "description": "The name of the agent bot" + }, + "description": { + "type": "string", + "description": "The description about the agent bot" + }, + "account_id": { + "type": "number", + "description": "Account ID if it's an account specific bot" + }, + "outgoing_url": { + "type": "string", + "description": "The webhook URL for the bot" + } + } + }, + "contact_inboxes": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Contact Inbox Source Id" + }, + "inbox": { + "$ref": "#/components/schemas/inbox" + } + } + }, + "contactable_inboxes": { + "type": "object", + "properties": { + "source_id": { + "type": "string", + "description": "Contact Inbox Source Id" + }, + "inbox": { + "$ref": "#/components/schemas/inbox" + } + } + }, + "custom_filter": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "The ID of the custom filter" + }, + "name": { + "type": "string", + "description": "The name of the custom filter" + }, + "type": { + "type": "string", + "enum": [ + "conversation", + "contact", + "report" + ], + "description": "The description about the custom filter" + }, + "query": { + "type": "object", + "description": "A query that needs to be saved as a custom filter" + }, + "created_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the custom filter was created" + }, + "updated_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the custom filter was updated" + } + } + }, + "webhook": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "The ID of the webhook" + }, + "url": { + "type": "string", + "description": "The url to which the events will be send" + }, + "subscriptions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "conversation_created", + "conversation_status_changed", + "conversation_updated", + "contact_created", + "contact_updated", + "message_created", + "message_updated", + "webwidget_triggered" + ] + }, + "description": "The list of subscribed events" + }, + "account_id": { + "type": "number", + "description": "The id of the account which the webhook object belongs to" + } + } + }, + "account": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "Account ID" + }, + "name": { + "type": "string", + "description": "Name of the account" + }, + "role": { + "type": "string", + "enum": [ + "administrator", + "agent" + ], + "description": "The user role in the account" + } + } + }, + "platform_account": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "Account ID" + }, + "name": { + "type": "string", + "description": "Name of the account" + } + } + }, + "team": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "The ID of the team" + }, + "name": { + "type": "string", + "description": "The name of the team" + }, + "description": { + "type": "string", + "description": "The description about the team" + }, + "allow_auto_assign": { + "type": "boolean", + "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" + }, + "account_id": { + "type": "number", + "description": "The ID of the account with the team is a part of" + }, + "is_member": { + "type": "boolean", + "description": "This field shows whether the current user is a part of the team" + } + } + }, + "integrations_app": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the integration" + }, + "name": { + "type": "string", + "description": "The name of the integration" + }, + "description": { + "type": "string", + "description": "The description about the team" + }, + "hook_type": { + "type": "string", + "description": "Whether the integration is an account or inbox integration" + }, + "enabled": { + "type": "boolean", + "description": "Whether the integration is enabled for the account" + }, + "allow_multiple_hooks": { + "type": "boolean", + "description": "Whether multiple hooks can be created for the integration" + }, + "hooks": { + "type": "array", + "items": { + "type": "object" + }, + "description": "If there are any hooks created for this integration" + } + } + }, + "integrations_hook": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The ID of the integration hook" + }, + "app_id": { + "type": "string", + "description": "The ID of the integration app" + }, + "inbox_id": { + "type": "string", + "description": "Inbox ID if its an Inbox integration" + }, + "account_id": { + "type": "string", + "description": "Account ID of the integration" + }, + "status": { + "type": "boolean", + "description": "Whether the integration hook is enabled for the account" + }, + "hook_type": { + "type": "boolean", + "description": "Whether its an account or inbox integration hook" + }, + "settings": { + "type": "object", + "description": "The associated settings for the integration" + } + } + }, + "public_contact": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Id of the contact" + }, + "source_id": { + "type": "string", + "description": "The session identifier of the contact" + }, + "name": { + "type": "string", + "description": "Name of the contact" + }, + "email": { + "type": "string", + "description": "Email of the contact" + }, + "pubsub_token": { + "type": "string", + "description": "The token to be used to connect to chatwoot websocket" + } + } + }, + "public_conversation": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "description": "Id of the conversation" + }, + "inbox_id": { + "type": "string", + "description": "The inbox id of the conversation" + }, + "messages": { + "type": "array", + "items": { + "$ref": "#/components/schemas/message" + }, + "description": "Messages in the conversation" + }, + "contact": { + "type": "object", + "description": "The contact information associated to the conversation" + } + } + }, + "public_message": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Id of the message" + }, + "content": { + "type": "string", + "description": "Text content of the message" + }, + "message_type": { + "type": "string", + "description": "Denotes the message type" + }, + "content_type": { + "type": "string", + "description": "Content type of the message" + }, + "content_attributes": { + "type": "string", + "description": "Additional content attributes of the message" + }, + "created_at": { + "type": "string", + "description": "Created at time stamp of the message" + }, + "conversation_id": { + "type": "string", + "description": "Conversation Id of the message" + }, + "attachments": { + "type": "array", + "items": { + "type": "object" + }, + "description": "Attachments if any" + }, + "sender": { + "type": "object", + "description": "Details of the sender" + } + } + }, + "public_inbox": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "Inbox identifier" + }, + "name": { + "type": "string", + "description": "Name of the inbox" + }, + "timezone": { + "type": "string", + "description": "The timezone defined on the inbox" + }, + "working_hours": { + "type": "array", + "description": "The working hours defined on the inbox", + "items": { + "type": "object", + "properties": { + "day_of_week": { + "type": "integer", + "description": "Day of the week as a number. Sunday -> 0, Saturday -> 6" + }, + "open_all_day": { + "type": "boolean", + "description": "Whether or not the business is open the whole day" + }, + "closed_all_day": { + "type": "boolean", + "description": "Whether or not the business is closed the whole day" + }, + "open_hour": { + "type": "integer", + "description": "Opening hour. Can be null if closed all day" + }, + "open_minutes": { + "type": "integer", + "description": "Opening minute. Can be null if closed all day" + }, + "close_hour": { + "type": "integer", + "description": "Closing hour. Can be null if closed all day" + }, + "close_minutes": { + "type": "integer", + "description": "Closing minute. Can be null if closed all day" + } + } + } + }, + "working_hours_enabled": { + "type": "boolean", + "description": "Whether of not the working hours are enabled on the inbox" + }, + "csat_survey_enabled": { + "type": "boolean", + "description": "Whether of not the Customer Satisfaction survey is enabled on the inbox" + }, + "greeting_enabled": { + "type": "boolean", + "description": "Whether of not the Greeting Message is enabled on the inbox" + }, + "identity_validation_enabled": { + "type": "boolean", + "description": "Whether of not the User Identity Validation is enforced on the inbox" + } + } + }, + "account_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the account" + } + } + }, + "agent_bot_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the agent bot" + }, + "description": { + "type": "string", + "description": "The description about the agent bot" + }, + "outgoing_url": { + "type": "string", + "description": "The webhook URL for the bot" + } + } + }, + "user_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the user" + }, + "email": { + "type": "string", + "description": "Email of the user" + }, + "password": { + "type": "string", + "description": "Password must contain uppercase, lowercase letters, number and a special character" + }, + "custom_attributes": { + "type": "object", + "description": "Custom attributes you want to associate with the user" + } + } + }, + "canned_response_create_update_payload": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "Message content for canned response" + }, + "short_code": { + "type": "string", + "description": "Short Code for quick access of the canned response" + } + } + }, + "custom_attribute_create_update_payload": { + "type": "object", + "properties": { + "attribute_display_name": { + "type": "string", + "description": "Attribute display name" + }, + "attribute_display_type": { + "type": "integer", + "description": "Attribute display type (text- 0, number- 1, currency- 2, percent- 3, link- 4, date- 5, list- 6, checkbox- 7)" + }, + "attribute_description": { + "type": "string", + "description": "Attribute description" + }, + "attribute_key": { + "type": "string", + "description": "Attribute unique key value" + }, + "attribute_values": { + "type": "array", + "description": "Attribute values", + "items": { + "type": "string" + } + }, + "attribute_model": { + "type": "integer", + "description": "Attribute type(conversation_attribute- 0, contact_attribute- 1)" + } + } + }, + "contact_create": { + "type": "object", + "required": [ + "inbox_id" + ], + "properties": { + "inbox_id": { + "type": "number" + }, + "name": { + "type": "string", + "description": "name of the contact" + }, + "email": { + "type": "string", + "description": "email of the contact" + }, + "phone_number": { + "type": "string", + "description": "phone number of the contact" + }, + "avatar": { + "type": "string", + "format": "binary", + "description": "Send the form data with the avatar image binary or use the avatar_url" + }, + "avatar_url": { + "type": "string", + "description": "The url to a jpeg, png file for the contact avatar" + }, + "identifier": { + "type": "string", + "description": "A unique identifier for the contact in external system" + }, + "custom_attributes": { + "type": "object", + "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}" + } + } + }, + "contact_update": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "name of the contact" + }, + "email": { + "type": "string", + "description": "email of the contact" + }, + "phone_number": { + "type": "string", + "description": "phone number of the contact" + }, + "avatar": { + "type": "string", + "format": "binary", + "description": "Send the form data with the avatar image binary or use the avatar_url" + }, + "avatar_url": { + "type": "string", + "description": "The url to a jpeg, png file for the contact avatar" + }, + "identifier": { + "type": "string", + "description": "A unique identifier for the contact in external system" + }, + "custom_attributes": { + "type": "object", + "description": "An object where you can store custom attributes for contact. example {\"type\":\"customer\", \"age\":30}" + } + } + }, + "conversation_message_create": { + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "description": "The content of the message" + }, + "message_type": { + "type": "string", + "enum": [ + "outgoing", + "incoming" + ] + }, + "private": { + "type": "boolean", + "description": "Flag to identify if it is a private note" + }, + "content_type": { + "type": "string", + "enum": [ + "text", + "input_email", + "cards", + "input_select", + "form", + "article" + ], + "example": "cards", + "description": "if you want to create custom message types" + }, + "content_attributes": { + "type": "object", + "description": "attributes based on your content type" + }, + "template_params": { + "type": "object", + "description": "The template params for the message in case of whatsapp Channel", + "properties": { + "name": { + "type": "string", + "description": "Name of the template", + "example": "sample_issue_resolution" + }, + "category": { + "type": "string", + "description": "Category of the template", + "example": "UTILITY" + }, + "language": { + "type": "string", + "description": "Language of the template", + "example": "en_US" + }, + "processed_params": { + "type": "object", + "description": "The processed param values for template variables in template", + "example": { + "1": "Chatwoot" + } + } + } + } + } + }, + "team_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the team" + }, + "description": { + "type": "string", + "description": "The description of the team" + }, + "allow_auto_assign": { + "type": "boolean", + "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" + } + } + }, + "custom_filter_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The name of the custom filter" + }, + "type": { + "type": "string", + "enum": [ + "conversation", + "contact", + "report" + ], + "description": "The description about the custom filter" + }, + "query": { + "type": "object", + "description": "A query that needs to be saved as a custom filter" + } + } + }, + "webhook_create_update_payload": { + "type": "object", + "properties": { + "url": { + "type": "string", + "description": "The url where the events should be sent" + }, + "subscriptions": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "conversation_created", + "conversation_status_changed", + "conversation_updated", + "message_created", + "message_updated", + "webwidget_triggered" + ] + }, + "description": "The events you want to subscribe to." + } + } + }, + "integrations_hook_create_payload": { + "type": "object", + "properties": { + "app_id": { + "type": "string", + "description": "The ID of app for which integration hook is being created" + }, + "inbox_id": { + "type": "string", + "description": "The inbox ID, if the hook is an inbox hook" + }, + "settings": { + "type": "object", + "description": "The settings required by the integration" + } + } + }, + "integrations_hook_update_payload": { + "type": "object", + "properties": { + "settings": { + "type": "object", + "description": "The settings required by the integration" + } + } + }, + "automation_rule_create_update_payload": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Rule name", + "example": "Add label on message create event" + }, + "description": { + "type": "string", + "description": "The description about the automation and actions", + "example": "Add label support and sales on message create event if incoming message content contains text help" + }, + "event_name": { "type": "string", "enum": [ "conversation_created", - "conversation_status_changed", "conversation_updated", - "message_created", - "message_updated", - "webwidget_triggered" + "message_created" + ], + "example": "message_created", + "description": "The event when you want to execute the automation actions" + }, + "active": { + "type": "boolean", + "description": "Enable/disable automation rule" + }, + "actions": { + "type": "array", + "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.", + "items": { + "type": "object", + "example": { + "action_name": "add_label", + "action_params": [ + "support" + ] + } + } + }, + "conditions": { + "type": "array", + "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.", + "items": { + "type": "object", + "example": { + "attribute_key": "content", + "filter_operator": "contains", + "query_operator": "nil", + "values": [ + "help" + ] + } + } + } + } + }, + "portal_create_update_payload": { + "type": "object", + "properties": { + "archived": { + "type": "boolean", + "description": "Status to check if portal is live" + }, + "color": { + "type": "string", + "description": "Header color for help-center", + "example": "add color HEX string, \"#fffff\"" + }, + "config": { + "type": "object", + "description": "Configuration about supporting locales", + "example": { + "allowed_locales": [ + "en", + "es" + ], + "default_locale": "en" + } + }, + "custom_domain": { + "type": "string", + "description": "Custom domain to display help center.", + "example": "chatwoot.help" + }, + "header_text": { + "type": "string", + "description": "Help center header", + "example": "Handbook" + }, + "homepage_link": { + "type": "string", + "description": "link to main dashboard", + "example": "https://www.chatwoot.com/" + }, + "name": { + "type": "string", + "description": "Name for the portal" + }, + "slug": { + "type": "string", + "description": "Slug for the portal to display in link" + }, + "page_title": { + "type": "string", + "description": "Page title for the portal" + }, + "account_id": { + "type": "integer" + } + } + }, + "category_create_update_payload": { + "type": "object", + "properties": { + "description": { + "type": "string", + "description": "Category description" + }, + "locale": { + "type": "string", + "description": "Category locale", + "example": "en/es" + }, + "name": { + "type": "string", + "description": "Category name" + }, + "slug": { + "type": "string", + "description": "Category slug" + }, + "position": { + "type": "integer", + "description": "Category position in the portal list to sort" + }, + "portal_id": { + "type": "integer" + }, + "account_id": { + "type": "integer" + }, + "associated_category_id": { + "type": "integer", + "description": "To associate similar categories to each other, e.g same category of product documentation in different languages" + }, + "parent_category_id": { + "type": "integer", + "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category." + } + } + }, + "article_create_update_payload": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "The text content." + }, + "meta": { + "type": "object", + "description": "Use for search", + "example": { + "tags": [ + "article_name" + ], + "title": "article title", + "description": "article description" + } + }, + "position": { + "type": "integer", + "description": "article position in category" + }, + "status": { + "type": "integer", + "example": [ + "draft", + "published", + "archived" ] }, - "description": "The events you want to subscribe to." + "title": { + "type": "string" + }, + "slug": { + "type": "string" + }, + "views": { + "type": "integer" + }, + "portal_id": { + "type": "integer" + }, + "account_id": { + "type": "integer" + }, + "author_id": { + "type": "integer" + }, + "category_id": { + "type": "integer" + }, + "folder_id": { + "type": "integer" + }, + "associated_article_id": { + "type": "integer", + "description": "To associate similar articles to each other, e.g to provide the link for the reference." + } } - } - }, - "integrations_hook_create_payload": { - "type": "object", - "properties": { - "app_id": { - "type": "string", - "description": "The ID of app for which integration hook is being created" - }, - "inbox_id": { - "type": "string", - "description": "The inbox ID, if the hook is an inbox hook" - }, - "settings": { - "type": "object", - "description": "The settings required by the integration" - } - } - }, - "integrations_hook_update_payload": { - "type": "object", - "properties": { - "settings": { - "type": "object", - "description": "The settings required by the integration" - } - } - }, - "automation_rule_create_update_payload": { - "type": "object", - "properties": { - "name": { - "type": "string", - "description": "Rule name", - "example": "Add label on message create event" - }, - "description": { - "type": "string", - "description": "The description about the automation and actions", - "example": "Add label support and sales on message create event if incoming message content contains text help" - }, - "event_name": { - "type": "string", - "enum": [ - "conversation_created", - "conversation_updated", - "message_created" - ], - "example": "message_created", - "description": "The event when you want to execute the automation actions" - }, - "active": { - "type": "boolean", - "description": "Enable/disable automation rule" - }, - "actions": { - "type": "array", - "description": "Array of actions which you want to perform when condition matches, e.g add label support if message contains content help.", - "items": { + }, + "public_contact_create_update_payload": { + "type": "object", + "properties": { + "identifier": { + "type": "string", + "description": "External identifier of the contact" + }, + "identifier_hash": { + "type": "string", + "description": "Identifier hash prepared for HMAC authentication" + }, + "email": { + "type": "string", + "description": "Email of the contact" + }, + "name": { + "type": "string", + "description": "Name of the contact" + }, + "phone_number": { + "type": "string", + "description": "Phone number of the contact" + }, + "avatar_url": { + "type": "string", + "description": "The url to a jpeg, png file for the user avatar" + }, + "custom_attributes": { "type": "object", - "example": { - "action_name": "add_label", - "action_params": [ - "support" - ] - } + "description": "Custom attributes of the customer" } - }, - "conditions": { - "type": "array", - "description": "Array of conditions on which conversation filter would work, e.g message content contains text help.", - "items": { + } + }, + "public_message_create_payload": { + "type": "object", + "properties": { + "content": { + "type": "string", + "description": "Content for the message" + }, + "echo_id": { + "type": "string", + "description": "Temporary identifier which will be passed back via websockets" + } + } + }, + "public_message_update_payload": { + "type": "object", + "properties": { + "submitted_values": { "type": "object", - "example": { - "attribute_key": "content", - "filter_operator": "contains", - "query_operator": "nil", - "values": [ - "help" - ] - } + "description": "Replies to the Bot Message Types" } } - } - }, - "portal_create_update_payload": { - "type": "object", - "properties": { - "archived": { - "type": "boolean", - "description": "Status to check if portal is live" - }, - "color": { - "type": "string", - "description": "Header color for help-center", - "example": "add color HEX string, \"#fffff\"" - }, - "config": { - "type": "object", - "description": "Configuration about supporting locales", - "example": { - "allowed_locales": [ - "en", - "es" - ], - "default_locale": "en" - } - }, - "custom_domain": { - "type": "string", - "description": "Custom domain to display help center.", - "example": "https://chatwoot.help/." - }, - "header_text": { - "type": "string", - "description": "Help center header", - "example": "Handbook" - }, - "homepage_link": { - "type": "string", - "description": "link to main dashboard", - "example": "https://www.chatwoot.com/" - }, - "name": { - "type": "string", - "description": "Name for the portal" - }, - "slug": { - "type": "string", - "description": "Slug for the portal to display in link" - }, - "page_title": { - "type": "string", - "description": "Page title for the portal" - }, - "account_id": { - "type": "integer" - } - } - }, - "category_create_update_payload": { - "type": "object", - "properties": { - "description": { - "type": "string", - "description": "Category description" - }, - "locale": { - "type": "string", - "description": "Category locale", - "example": "en/es" - }, - "name": { - "type": "string", - "description": "Category name" - }, - "slug": { - "type": "string", - "description": "Category slug" - }, - "position": { - "type": "integer", - "description": "Category position in the portal list to sort" - }, - "portal_id": { - "type": "integer" - }, - "account_id": { - "type": "integer" - }, - "associated_category_id": { - "type": "integer", - "description": "To associate similar categories to each other, e.g same category of product documentation in different languages" - }, - "parent_category_id": { - "type": "integer", - "description": "To define parent category, e.g product documentation has multiple level features in sales category or in engineering category." - } - } - }, - "article_create_update_payload": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "The text content." - }, - "meta": { - "type": "object", - "description": "Use for search", - "example": { - "tags": [ - "article_name" - ], - "title": "article title", - "description": "article description" - } - }, - "position": { - "type": "integer", - "description": "article position in category" - }, - "status": { - "type": "integer", - "example": [ - "draft", - "published", - "archived" - ] - }, - "title": { - "type": "string" - }, - "slug": { - "type": "string" - }, - "views": { - "type": "integer" - }, - "portal_id": { - "type": "integer" - }, - "account_id": { - "type": "integer" - }, - "author_id": { - "type": "integer" - }, - "category_id": { - "type": "integer" - }, - "folder_id": { - "type": "integer" - }, - "associated_article_id": { - "type": "integer", - "description": "To associate similar articles to each other, e.g to provide the link for the reference." - } - } - }, - "public_contact_create_update_payload": { - "type": "object", - "properties": { - "identifier": { - "type": "string", - "description": "External identifier of the contact" - }, - "identifier_hash": { - "type": "string", - "description": "Identifier hash prepared for HMAC authentication" - }, - "email": { - "type": "string", - "description": "Email of the contact" - }, - "name": { - "type": "string", - "description": "Name of the contact" - }, - "phone_number": { - "type": "string", - "description": "Phone number of the contact" - }, - "avatar_url": { - "type": "string", - "description": "The url to a jpeg, png file for the user avatar" - }, - "custom_attributes": { - "type": "object", - "description": "Custom attributes of the customer" - } - } - }, - "public_message_create_payload": { - "type": "object", - "properties": { - "content": { - "type": "string", - "description": "Content for the message" - }, - "echo_id": { - "type": "string", - "description": "Temporary identifier which will be passed back via websockets" - } - } - }, - "public_message_update_payload": { - "type": "object", - "properties": { - "submitted_values": { - "type": "object", - "description": "Replies to the Bot Message Types" - } - } - }, - "public_conversation_create_payload": { - "type": "object", - "properties": { - "custom_attributes": { - "type": "object", - "description": "Custom attributes of the conversation" - } - } - }, - "extended_contact": { - "allOf": [ - { - "$ref": "#/definitions/contact" - }, - { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "Id of the user" - }, - "availability_status": { - "type": "string", - "enum": [ - "online", - "offline" - ], - "description": "Availability status of the user" - } + }, + "public_conversation_create_payload": { + "type": "object", + "properties": { + "custom_attributes": { + "type": "object", + "description": "Custom attributes of the conversation" } } - ] - }, - "contact_base": { - "allOf": [ - { - "$ref": "#/definitions/generic_id" - }, - { - "$ref": "#/definitions/contact" - } - ] - }, - "contact_list": { - "type": "array", - "description": "array of contacts", - "items": { + }, + "extended_contact": { "allOf": [ { - "$ref": "#/definitions/generic_id" + "$ref": "#/components/schemas/contact" }, { - "$ref": "#/definitions/contact" + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "Id of the user" + }, + "availability_status": { + "type": "string", + "enum": [ + "online", + "offline" + ], + "description": "Availability status of the user" + } + } } ] - } - }, - "contact_conversations": { - "type": "array", - "description": "array of conversations", - "items": { + }, + "contact_base": { "allOf": [ { - "$ref": "#/definitions/conversation" + "$ref": "#/components/schemas/generic_id" + }, + { + "$ref": "#/components/schemas/contact" + } + ] + }, + "contact_list": { + "type": "array", + "description": "array of contacts", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/generic_id" + }, + { + "$ref": "#/components/schemas/contact" + } + ] + } + }, + "contact_conversations": { + "type": "array", + "description": "array of conversations", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/conversation" + }, + { + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "sender": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID fo the sender" + }, + "name": { + "type": "string", + "description": "The name of the sender" + }, + "thumbnail": { + "type": "string", + "description": "Avatar URL of the contact" + }, + "channel": { + "type": "string", + "description": "Channel Type" + } + } + }, + "assignee": { + "$ref": "#/components/schemas/user" + } + } + } + } + }, + { + "type": "object", + "properties": { + "display_id": { + "type": "number" + } + } + } + ] + } + }, + "contact_labels": { + "type": "object", + "properties": { + "payload": { + "type": "array", + "description": "Array of labels", + "items": { + "type": "string" + } + } + } + }, + "conversation_list": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "mine_count": { + "type": "number" + }, + "unassigned_count": { + "type": "number" + }, + "assigned_count": { + "type": "number" + }, + "all_count": { + "type": "number" + } + } + }, + "payload": { + "type": "array", + "description": "array of conversations", + "items": { + "allOf": [ + { + "$ref": "#/components/schemas/generic_id" + }, + { + "$ref": "#/components/schemas/conversation" + }, + { + "type": "object", + "properties": { + "meta": { + "type": "object", + "properties": { + "sender": { + "type": "object", + "properties": { + "id": { + "type": "number", + "description": "ID fo the sender" + }, + "name": { + "type": "string", + "description": "The name of the sender" + }, + "thumbnail": { + "type": "string", + "description": "Avatar URL of the contact" + }, + "channel": { + "type": "string", + "description": "Channel Type" + } + } + }, + "assignee": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + ] + } + } + } + } + } + }, + "conversation_show": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/conversation" }, { "type": "object", @@ -7133,427 +9137,348 @@ } }, "assignee": { - "$ref": "#/definitions/user" + "$ref": "#/components/schemas/user" } } } } - }, - { - "type": "object", - "properties": { - "display_id": { - "type": "number" - } - } } ] - } - }, - "contact_labels": { - "type": "object", - "properties": { - "payload": { - "type": "array", - "description": "Array of labels", - "items": { - "type": "string" - } - } - } - }, - "conversation_list": { - "type": "object", - "properties": { - "data": { - "type": "object", - "properties": { - "meta": { - "type": "object", - "properties": { - "mine_count": { - "type": "number" - }, - "unassigned_count": { - "type": "number" - }, - "assigned_count": { - "type": "number" - }, - "all_count": { - "type": "number" - } - } - }, - "payload": { - "type": "array", - "description": "array of conversations", - "items": { - "allOf": [ - { - "$ref": "#/definitions/generic_id" - }, - { - "$ref": "#/definitions/conversation" - }, - { - "type": "object", - "properties": { - "meta": { - "type": "object", - "properties": { - "sender": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID fo the sender" - }, - "name": { - "type": "string", - "description": "The name of the sender" - }, - "thumbnail": { - "type": "string", - "description": "Avatar URL of the contact" - }, - "channel": { - "type": "string", - "description": "Channel Type" - } - } - }, - "assignee": { - "$ref": "#/definitions/user" - } - } - } - } - } + }, + "conversation_status_toggle": { + "type": "object", + "properties": { + "meta": { + "type": "object" + }, + "payload": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + }, + "current_status": { + "type": "string", + "enum": [ + "open", + "resolved" ] + }, + "conversation_id": { + "type": "number" } } } } - } - }, - "conversation_show": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/conversation" - }, - { - "type": "object", - "properties": { - "meta": { - "type": "object", - "properties": { - "sender": { - "type": "object", - "properties": { - "id": { - "type": "number", - "description": "ID fo the sender" - }, - "name": { - "type": "string", - "description": "The name of the sender" - }, - "thumbnail": { - "type": "string", - "description": "Avatar URL of the contact" - }, - "channel": { - "type": "string", - "description": "Channel Type" - } - } - }, - "assignee": { - "$ref": "#/definitions/user" - } - } + }, + "conversation_labels": { + "type": "object", + "properties": { + "payload": { + "type": "array", + "description": "Array of labels", + "items": { + "type": "string" } } } - ] - }, - "conversation_status_toggle": { - "type": "object", - "properties": { - "meta": { - "type": "object" - }, - "payload": { - "type": "object", - "properties": { - "success": { - "type": "boolean" - }, - "current_status": { - "type": "string", - "enum": [ - "open", - "resolved" - ] - }, - "conversation_id": { - "type": "number" - } - } - } - } - }, - "conversation_labels": { - "type": "object", - "properties": { - "payload": { - "type": "array", - "description": "Array of labels", - "items": { + }, + "account_summary": { + "type": "object", + "properties": { + "avg_first_response_time": { "type": "string" + }, + "avg_resolution_time": { + "type": "string" + }, + "conversations_count": { + "type": "number" + }, + "incoming_messages_count": { + "type": "number" + }, + "outgoing_messages_count": { + "type": "number" + }, + "resolutions_count": { + "type": "number" + }, + "previous": { + "type": "object", + "properties": { + "avg_first_response_time": { + "type": "string" + }, + "avg_resolution_time": { + "type": "string" + }, + "conversations_count": { + "type": "number" + }, + "incoming_messages_count": { + "type": "number" + }, + "outgoing_messages_count": { + "type": "number" + }, + "resolutions_count": { + "type": "number" + } + } } } - } - }, - "account_summary": { - "type": "object", - "properties": { - "avg_first_response_time": { - "type": "string" - }, - "avg_resolution_time": { - "type": "string" - }, - "conversations_count": { - "type": "number" - }, - "incoming_messages_count": { - "type": "number" - }, - "outgoing_messages_count": { - "type": "number" - }, - "resolutions_count": { - "type": "number" - }, - "previous": { - "type": "object", - "properties": { - "avg_first_response_time": { - "type": "string" - }, - "avg_resolution_time": { - "type": "string" - }, - "conversations_count": { - "type": "number" - }, - "incoming_messages_count": { - "type": "number" - }, - "outgoing_messages_count": { - "type": "number" - }, - "resolutions_count": { - "type": "number" + }, + "agent_conversation_metrics": { + "type": "object", + "properties": { + "id": { + "type": "number" + }, + "name": { + "type": "string" + }, + "email": { + "type": "string" + }, + "thumbnail": { + "type": "string" + }, + "availability": { + "type": "string" + }, + "metric": { + "type": "object", + "properties": { + "open": { + "type": "number" + }, + "unattended": { + "type": "number" + } } } } } }, - "agent_conversation_metrics": { - "type": "object", - "properties": { - "id": { - "type": "number" + "parameters": { + "account_id": { + "in": "path", + "name": "account_id", + "schema": { + "type": "integer" }, - "name": { + "required": true, + "description": "The numeric ID of the account" + }, + "agent_bot_id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The ID of the agentbot to be updated" + }, + "team_id": { + "in": "path", + "name": "team_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The ID of the team to be updated" + }, + "inbox_id": { + "in": "path", + "name": "inbox_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The ID of the Inbox" + }, + "hook_id": { + "in": "path", + "name": "hook_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the integration hook" + }, + "source_id": { + "in": "path", + "name": "source_id", + "required": true, + "schema": { "type": "string" }, - "email": { + "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.

Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String" + }, + "contact_sort_param": { + "in": "query", + "name": "sort", + "schema": { + "type": "string", + "enum": [ + "name", + "email", + "phone_number", + "last_activity_at", + "-name", + "-email", + "-phone_number", + "-last_activity_at" + ] + }, + "required": false, + "description": "The attribute by which list should be sorted" + }, + "conversation_id": { + "in": "path", + "name": "conversation_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the conversation" + }, + "conversation_uuid": { + "in": "path", + "name": "conversation_uuid", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The uuid of the conversation" + }, + "custom_filter_id": { + "in": "path", + "name": "custom_filter_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the custom filter" + }, + "webhook_id": { + "in": "path", + "name": "webhook_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the webhook" + }, + "message_id": { + "in": "path", + "name": "message_id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the message" + }, + "page": { + "in": "query", + "name": "page", + "schema": { + "type": "integer", + "default": 1 + }, + "required": false, + "description": "The page parameter" + }, + "platform_user_id": { + "in": "path", + "name": "id", + "schema": { + "type": "integer" + }, + "required": true, + "description": "The numeric ID of the user on the platform" + }, + "report_type": { + "in": "query", + "name": "type", + "schema": { + "type": "string", + "enum": [ + "account", + "agent", + "inbox", + "label", + "team" + ] + }, + "required": true, + "description": "Type of report" + }, + "report_metric": { + "in": "query", + "name": "metric", + "schema": { + "type": "string", + "enum": [ + "conversations_count", + "incoming_messages_count", + "outgoing_messages_count", + "avg_first_response_time", + "avg_resolution_time", + "resolutions_count" + ] + }, + "required": true, + "description": "The type of metric" + }, + "public_inbox_identifier": { + "in": "path", + "name": "inbox_identifier", + "schema": { "type": "string" }, - "thumbnail": { + "required": true, + "description": "The identifier obtained from API inbox channel" + }, + "public_contact_identifier": { + "in": "path", + "name": "contact_identifier", + "schema": { "type": "string" }, - "availability": { - "type": "string" + "required": true, + "description": "The source id of contact obtained on contact create" + }, + "portal_id": { + "in": "path", + "name": "portal_id", + "schema": { + "type": "integer" }, - "metric": { - "type": "object", - "properties": { - "open": { - "type": "number" - }, - "unattended": { - "type": "number" - } - } - } + "required": true, + "description": "The numeric ID of the portal" } - } - }, - "parameters": { - "account_id": { - "in": "path", - "name": "account_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the account" }, - "agent_bot_id": { - "in": "path", - "name": "id", - "type": "integer", - "required": true, - "description": "The ID of the agentbot to be updated" - }, - "team_id": { - "in": "path", - "name": "team_id", - "type": "integer", - "required": true, - "description": "The ID of the team to be updated" - }, - "inbox_id": { - "in": "path", - "name": "inbox_id", - "type": "integer", - "required": true, - "description": "The ID of the Inbox" - }, - "hook_id": { - "in": "path", - "name": "hook_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the integration hook" - }, - "source_id": { - "in": "path", - "name": "source_id", - "required": true, - "type": "string", - "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.

Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String" - }, - "contact_sort_param": { - "in": "query", - "name": "sort", - "type": "string", - "enum": [ - "name", - "email", - "phone_number", - "last_activity_at", - "-name", - "-email", - "-phone_number", - "-last_activity_at" - ], - "required": false, - "description": "The attribute by which list should be sorted" - }, - "conversation_id": { - "in": "path", - "name": "conversation_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the conversation" - }, - "conversation_uuid": { - "in": "path", - "name": "conversation_uuid", - "type": "integer", - "required": true, - "description": "The uuid of the conversation" - }, - "custom_filter_id": { - "in": "path", - "name": "custom_filter_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the custom filter" - }, - "webhook_id": { - "in": "path", - "name": "webhook_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the webhook" - }, - "message_id": { - "in": "path", - "name": "message_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the message" - }, - "page": { - "in": "query", - "name": "page", - "type": "integer", - "default": 1, - "required": false, - "description": "The page parameter" - }, - "platform_user_id": { - "in": "path", - "name": "id", - "type": "integer", - "required": true, - "description": "The numeric ID of the user on the platform" - }, - "report_type": { - "in": "query", - "name": "type", - "type": "string", - "enum": [ - "account", - "agent", - "inbox", - "label", - "team" - ], - "required": true, - "description": "Type of report" - }, - "report_metric": { - "in": "query", - "name": "metric", - "type": "string", - "enum": [ - "conversations_count", - "incoming_messages_count", - "outgoing_messages_count", - "avg_first_response_time", - "avg_resolution_time", - "resolutions_count" - ], - "required": true, - "description": "The type of metric" - }, - "public_inbox_identifier": { - "in": "path", - "name": "inbox_identifier", - "type": "string", - "required": true, - "description": "The identifier obtained from API inbox channel" - }, - "public_contact_identifier": { - "in": "path", - "name": "contact_identifier", - "type": "string", - "required": true, - "description": "The source id of contact obtained on contact create" - }, - "portal_id": { - "in": "path", - "name": "portal_id", - "type": "integer", - "required": true, - "description": "The numeric ID of the portal" + "securitySchemes": { + "userApiKey": { + "type": "apiKey", + "in": "header", + "name": "api_access_token", + "description": "This token can be obtained by visiting the profile page or via rails console. Provides access to endpoints based on the user permissions levels. This token can be saved by an external system when user is created via API, to perform activities on behalf of the user." + }, + "agentBotApiKey": { + "type": "apiKey", + "in": "header", + "name": "api_access_token", + "description": "This token should be provided by system admin or obtained via rails console. This token can be used to build bot integrations and can only access limited apis." + }, + "platformAppApiKey": { + "type": "apiKey", + "in": "header", + "name": "api_access_token", + "description": "This token can be obtained by the system admin after creating a platformApp. This token should be used to provision agent bots, accounts, users and their roles." + } } }, "x-tagGroups": [