feat: Update swagger to openapi 3.0.4

This commit is contained in:
Daniel Jimenez
2025-05-13 14:29:02 +12:00
committed by Daniel Jimenez
parent 696611ae63
commit 444668c646
159 changed files with 8552 additions and 5578 deletions
+1 -1
View File
@@ -6,4 +6,4 @@ properties:
errors:
type: array
items:
$ref: '#/definitions/request_error'
$ref: '#/components/schemas/request_error'
+7 -15
View File
@@ -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'
@@ -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'
@@ -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
+2 -3
View File
@@ -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.
+3 -2
View File
@@ -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'
@@ -5,4 +5,4 @@ properties:
description: Contact Inbox Source Id
inbox:
type: object
$ref: '#/definitions/inbox'
$ref: '#/components/schemas/inbox'
@@ -5,4 +5,4 @@ properties:
description: Contact Inbox Source Id
inbox:
type: object
$ref: '#/definitions/inbox'
$ref: '#/components/schemas/inbox'
@@ -6,7 +6,7 @@ properties:
messages:
type: array
items:
$ref: '#/definitions/message'
$ref: '#/components/schemas/message'
account_id:
type: number
description: Account Id
@@ -19,4 +19,4 @@ properties:
type: string
description: Channel Type
assignee:
$ref: '#/definitions/user'
$ref: '#/components/schemas/user'
@@ -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'
@@ -1,4 +1,4 @@
type: object
allOf:
- $ref: '#/definitions/conversation'
- $ref: '#/components/schemas/conversation'
- $ref: '../contact/conversation.yml'
+2 -2
View File
@@ -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'
@@ -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
description: The token to be used to connect to chatwoot websocket
@@ -9,7 +9,7 @@ properties:
messages:
type: array
items:
$ref: '#/definitions/message'
$ref: '#/components/schemas/message'
description: Messages in the conversation
contact:
type: object
+2 -2
View File
@@ -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'
+27 -35
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: account_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the account
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: id
type: integer
schema:
type: integer
required: true
description: The ID of the agentbot to be updated
+11 -10
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: conversation_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the conversation
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: conversation_uuid
type: integer
schema:
type: integer
required: true
description: The uuid of the conversation
+2 -1
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: hook_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the integration hook
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: inbox_id
type: integer
schema:
type: integer
required: true
description: The ID of the Inbox
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: message_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the message
+3 -2
View File
@@ -1,6 +1,7 @@
in: query
name: page
type: integer
default: 1
schema:
type: integer
default: 1
required: false
description: The page parameter
+2 -1
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: portal_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the portal
@@ -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
@@ -1,5 +1,6 @@
in: path
name: inbox_identifier
type: string
schema:
type: string
required: true
description: The identifier obtained from API inbox channel
+9 -8
View File
@@ -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
+8 -7
View File
@@ -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
+2 -1
View File
@@ -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.<br/><br/>Website: Chatwoot generated string which can be obtained from webhook events. <br/> Phone Channels(Twilio): Phone number in e164 format <br/> Email Channels: Contact Email address <br/> API Channel: Any Random String"
+2 -1
View File
@@ -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
+2 -1
View File
@@ -1,5 +1,6 @@
in: path
name: webhook_id
type: integer
schema:
type: integer
required: true
description: The numeric ID of the webhook
+16 -11
View File
@@ -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'
@@ -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'
+13 -8
View File
@@ -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'
+15 -5
View File
@@ -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'
+16 -10
View File
@@ -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'
+39 -33
View File
@@ -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'
+11 -2
View File
@@ -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'
+11 -5
View File
@@ -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'
+35 -23
View File
@@ -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'
+14 -8
View File
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+14 -8
View File
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+52 -22
View File
@@ -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'
+47 -41
View File
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+18 -13
View File
@@ -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'
@@ -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'
@@ -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
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
@@ -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'
+121 -100
View File
@@ -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 <br/> 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 <br/> 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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+35 -26
View File
@@ -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'
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+51 -40
View File
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
@@ -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'
+19 -9
View File
@@ -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'
@@ -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'
+18 -7
View File
@@ -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'

Some files were not shown because too many files have changed in this diff Show More