Restructure omni services and add Chatwoot research snapshot

This commit is contained in:
Ruslan Bakiev
2026-02-21 11:11:27 +07:00
parent edea7a0034
commit b73babbbf6
7732 changed files with 978203 additions and 32 deletions

View File

@@ -0,0 +1,42 @@
tags:
- Conversation Assignments
operationId: assign-a-conversation
summary: Assign Conversation
description: Assign a conversation to an agent or a team
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
assignee_id:
type: number
description: Id of the assignee user
example: 1
team_id:
type: number
description: Id of the team. If the assignee_id is present, this param would be ignored
example: 1
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/user'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,45 @@
tags:
- Conversations
operationId: update-custom-attributes-of-a-conversation
summary: Update Custom Attributes
description: Updates the custom attributes of a conversation
security:
- userApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- custom_attributes
properties:
custom_attributes:
type: object
description: The custom attributes to be set for the conversation
example:
order_id: '12345'
previous_conversation: '67890'
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
custom_attributes:
type: object
description: The custom attributes of the conversation
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,63 @@
tags:
- Conversations
operationId: conversationFilter
description: Filter conversations with custom filter options and pagination
summary: Conversations Filter
security:
- userApiKey: []
parameters:
- name: page
in: query
schema:
type: number
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
payload:
type: array
items:
type: object
properties:
attribute_key:
type: string
description: filter attribute name
filter_operator:
type: string
description: filter operator name
enum: [equal_to, not_equal_to, contains, does_not_contain]
values:
type: array
items:
type: string
description: array of the attribute values to filter
query_operator:
type: string
description: query operator name
enum: [AND, OR]
example:
- attribute_key: 'browser_language'
filter_operator: 'not_equal_to'
values: ['en']
query_operator: 'AND'
- attribute_key: 'status'
filter_operator: 'equal_to'
values: ['pending']
query_operator: null
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_list'
'400':
description: Bad Request Error
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,104 @@
parameters:
- $ref: '#/components/parameters/account_id'
get:
tags:
- Conversations
operationId: conversationList
description: List all the conversations with pagination
summary: Conversations List
security:
- userApiKey: []
parameters:
- name: assignee_type
in: query
schema:
type: string
enum: ['me', 'unassigned', 'all', 'assigned']
default: 'all'
description: Filter conversations by assignee type.
- name: status
in: query
schema:
type: string
enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
default: 'open'
description: Filter by conversation status.
- name: q
in: query
schema:
type: string
description: Filters conversations with messages containing the search term
- name: inbox_id
in: query
schema:
type: integer
- name: team_id
in: query
schema:
type: integer
- name: labels
in: query
schema:
type: array
items:
type: string
- name: page
in: query
schema:
type: integer
default: 1
description: paginate through conversations
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_list'
'400':
description: Bad Request Error
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
post:
tags:
- Conversations
operationId: newConversation
summary: Create New Conversation
description: "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://www.chatwoot.com/hc/user-guide/articles/1677839703-how-to-create-an-api-channel-inbox#send-messages-to-the-api-channel"
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_create_payload'
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
id:
type: number
description: ID of the conversation
account_id:
type: number
description: Account Id
inbox_id:
type: number
description: ID of the inbox
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,41 @@
tags:
- Conversations
operationId: conversation-add-labels
summary: Add Labels
security:
- userApiKey: []
description: Add labels to a conversation. Note that this API would overwrite the existing list of labels associated to the conversation.
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- labels
properties:
labels:
type: array
description: Array of labels (comma-separated strings)
items:
type: string
example: ['support', 'billing']
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_labels'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,26 @@
tags:
- Conversations
operationId: list-all-labels-of-a-conversation
summary: List Labels
security:
- userApiKey: []
description: Lists all the labels of a conversation
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_labels'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,85 @@
tags:
- Messages
operationId: create-a-new-message-in-a-conversation
summary: Create New Message
description: |
Create a new message in the conversation.
## WhatsApp Template Messages
For WhatsApp channels, you can send structured template messages using the `template_params` field.
Templates must be pre-approved in WhatsApp Business Manager.
### Example Templates
**Text with Image Header:**
```json
{
"content": "Hi your order 121212 is confirmed. Please wait for further updates",
"template_params": {
"name": "order_confirmation",
"category": "MARKETING",
"language": "en",
"processed_params": {
"body": {
"1": "121212"
},
"header": {
"media_url": "https://picsum.photos/200/300",
"media_type": "image"
}
}
}
}
```
**Text with Copy Code Button:**
```json
{
"content": "Special offer! Get 30% off your next purchase. Use the code below",
"template_params": {
"name": "discount_coupon",
"category": "MARKETING",
"language": "en",
"processed_params": {
"body": {
"discount_percentage": "30"
},
"buttons": [{
"type": "copy_code",
"parameter": "SAVE20"
}]
}
}
}
```
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_message_create_payload'
responses:
'200':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/generic_id'
- $ref: '#/components/schemas/message'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,57 @@
post:
tags:
- Messages
operationId: conversationNewMessageAttachment
summary: Create New Message Attachment
description: Create an attachment message.
security:
- userApiKey: []
parameters:
- $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':
description: Success
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/generic_id'
- $ref: '#/components/schemas/message'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,22 @@
tags:
- Messages
operationId: delete-a-message
summary: Delete a message
security:
- userApiKey: []
description: Delete a message and it's attachments from the conversation.
responses:
'200':
description: Success
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: The message or conversation does not exist in the account
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,51 @@
tags:
- Messages
operationId: list-all-messages
summary: Get messages
security:
- userApiKey: []
description: List all messages of a conversation
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
meta:
type: object
properties:
labels:
type: array
items:
type: string
additional_attributes:
type: object
contact:
$ref: '#/components/schemas/contact'
assignee:
$ref: '#/components/schemas/agent'
agent_last_seen_at:
type: string
format: date-time
assignee_last_seen_at:
type: string
format: date-time
payload:
type: array
description: Array of messages
items:
$ref: '#/components/schemas/message'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,64 @@
parameters:
- $ref: '#/components/parameters/account_id'
get:
tags:
- Conversations
operationId: conversationListMeta
description: Get open, unassigned and all Conversation counts
summary: Get Conversation Counts
security:
- userApiKey: []
parameters:
- name: status
in: query
schema:
type: string
enum: ['all', 'open', 'resolved', 'pending', 'snoozed']
default: 'open'
description: Filter by conversation status.
- name: q
in: query
schema:
type: string
description: Filters conversations with messages containing the search term
- name: inbox_id
in: query
schema:
type: integer
- name: team_id
in: query
schema:
type: integer
- name: labels
in: query
schema:
type: array
items:
type: string
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
meta:
type: object
properties:
mine_count:
type: number
unassigned_count:
type: number
assigned_count:
type: number
all_count:
type: number
'400':
description: Bad Request Error
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,29 @@
tags:
- Conversations
operationId: get-conversation-reporting-events
summary: Conversation Reporting Events
security:
- userApiKey: []
description: Get reporting events for a specific conversation. This endpoint returns events such as first response time, resolution time, and other metrics for the conversation, sorted by creation time in ascending order.
responses:
'200':
description: Success
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/reporting_event'
description: Array of reporting events for the conversation
'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'

View File

@@ -0,0 +1,26 @@
tags:
- Conversations
operationId: get-details-of-a-conversation
summary: Conversation Details
security:
- userApiKey: []
description: Get all details regarding a conversation with all messages in the conversation
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/conversation_show'
'403':
description: Access denied
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,37 @@
tags:
- Conversations
operationId: toggle-priority-of-a-conversation
summary: Toggle Priority
description: Toggles the priority of conversation
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- priority
properties:
priority:
type: string
enum: ['urgent', 'high', 'medium', 'low', 'none']
description: 'The priority of the conversation'
example: 'high'
responses:
'200':
description: Success
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,67 @@
tags:
- Conversations
operationId: toggle-status-of-a-conversation
summary: Toggle Status
description: |-
Toggle the status of a conversation. Pass `status` to explicitly set the
conversation state. Use `snoozed` along with `snoozed_until` to snooze a
conversation until a specific time. If `snoozed_until` is omitted, the
conversation is snoozed until the next reply from the contact. Regardless
of the value provided, snoozed conversations always reopen on the next
reply from the contact.
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- status
properties:
status:
type: string
enum: ['open', 'resolved', 'pending', 'snoozed']
description: The status of the conversation
example: open
snoozed_until:
type: number
description: When status is `snoozed`, schedule the reopen time as a Unix timestamp in seconds.
If not provided, the conversation is snoozed until the next
customer reply. The conversation always reopens when the
customer replies.
example: 1757506877
responses:
'200':
description: Success
content:
application/json:
schema:
type: object
properties:
meta:
type: object
payload:
type: object
properties:
success:
type: boolean
current_status:
type: string
enum: ['open', 'resolved', 'pending', 'snoozed']
conversation_id:
type: number
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,39 @@
tags:
- Conversations
operationId: update-conversation
summary: Update Conversation
description: Update Conversation Attributes
security:
- userApiKey: []
- agentBotApiKey: []
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
priority:
type: string
enum: ['urgent', 'high', 'medium', 'low', 'none']
description: 'The priority of the conversation'
example: 'high'
sla_policy_id:
type: number
description: 'The ID of the SLA policy (Available only in Enterprise edition)'
example: 1
responses:
'200':
description: Success
'401':
description: Unauthorized
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'
'404':
description: Conversation not found
content:
application/json:
schema:
$ref: '#/components/schemas/bad_request_error'

View File

@@ -0,0 +1,29 @@
post:
tags:
- Conversations
operationId: conversationUpdateLastSeen
summary: Update Last Seen
security:
- userApiKey: []
description: Updates the last seen of the conversation so that conversations will have the bubbles in the agents screen
parameters:
- name: id
in: path
type: number
description: ID of the conversation
required: true
responses:
'200':
description: Success
'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'