{ "swagger": "2.0", "info": { "description": "This is the API documentation for Chatwoot server.", "version": "1.0.0", "title": "Chatwoot", "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": null, "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": [ ] } ], "paths": { "platform/api/v1/accounts": { "post": { "tags": [ "Accounts" ], "operationId": "create-an-account", "summary": "Create an Account", "description": "Create an Account", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/account_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/platform_account" } }, "401": { "description": "Unauthorized" } } } }, "platform/api/v1/accounts/{id}": { "parameters": [ { "$ref": "#/parameters/account_id" } ], "get": { "tags": [ "Accounts" ], "operationId": "get-details-of-an-account", "summary": "Get an account details", "description": "Get the details of an account", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/platform_account" } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given account does not exist" } } }, "patch": { "tags": [ "Accounts" ], "operationId": "update-an-account", "summary": "Update an account", "description": "Update an account's attributes", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/account_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/platform_account" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Accounts" ], "operationId": "delete-an-account", "summary": "Delete an Account", "description": "Delete an Account", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The account does not exist" } } } }, "platform/api/v1/accounts/{id}/account_users": { "parameters": [ { "$ref": "#/parameters/account_id" } ], "get": { "tags": [ "Account Users" ], "operationId": "list-all-account-users", "summary": "List all Account Users", "description": "List all account users", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of account users", "items": { "type": "object", "properties": { "account_id": { "type": "integer", "description": "The ID of the user" }, "user_id": { "type": "integer", "description": "The ID of the user" }, "role": { "type": "string", "description": "whether user is an administrator or agent" } } } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "Account Users" ], "operationId": "create-an-account-user", "summary": "Create an Account User", "description": "Create an Account User", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "The ID of the user", "required": true }, "role": { "type": "string", "description": "whether user is an administrator or agent", "required": true } } } } ], "responses": { "200": { "description": "Success", "schema": { "properties": { "account_id": { "type": "integer", "description": "The ID of the user" }, "user_id": { "type": "integer", "description": "The ID of the user" }, "role": { "type": "string", "description": "whether user is an administrator or agent" } } } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Account Users" ], "operationId": "delete-an-account-user", "summary": "Delete an Account User", "description": "Delete an Account User", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "user_id": { "type": "integer", "description": "The ID of the user", "required": true } } } } ], "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The account does not exist" } } } }, "platform/api/v1/agent_bots": { "get": { "tags": [ "AgentBots" ], "operationId": "list-all-agent-bots", "summary": "List all AgentBots", "description": "List all agent bots available", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of agent bots", "items": { "$ref": "#/definitions/agent_bot" } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "AgentBots" ], "operationId": "create-an-agent-bot", "summary": "Create an Agent Bot", "description": "Create an agent bot", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent_bot_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" } } } }, "platform/api/v1/agent_bots/{id}": { "parameters": [ { "$ref": "#/parameters/agent_bot_id" } ], "get": { "tags": [ "AgentBots" ], "operationId": "get-details-of-a-single-agent-bot", "summary": "Get an agent bot details", "description": "Get the details of an agent bot", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given agent bot ID does not exist" } } }, "patch": { "tags": [ "AgentBots" ], "operationId": "update-an-agent-bot", "summary": "Update an agent bot", "description": "Update an agent bot's attributes", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/agent_bot_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "AgentBots" ], "operationId": "delete-an-agent-bot", "summary": "Delete an AgentBot", "description": "Delete an AgentBot", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The agent bot does not exist" } } } }, "platform/api/v1/users": { "post": { "tags": [ "Users" ], "operationId": "create-a-user", "summary": "Create a User", "description": "Create a User", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Unauthorized" } } } }, "platform/api/v1/users/{id}": { "parameters": [ { "$ref": "#/parameters/platform_user_id" } ], "get": { "tags": [ "Users" ], "operationId": "get-details-of-a-user", "summary": "Get an user details", "description": "Get the details of an user", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given user does not exist" } } }, "patch": { "tags": [ "Users" ], "operationId": "update-a-user", "summary": "Update a user", "description": "Update a user's attributes", "security": [ { "platformAppApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/user_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Users" ], "operationId": "delete-a-user", "summary": "Delete a User", "description": "Delete a User", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The user does not exist" } } } }, "platform/api/v1/users/{id}/login": { "get": { "tags": [ "Users" ], "operationId": "get-sso-url-of-a-user", "summary": "Get User SSO Link", "description": "Get the sso link of a user", "security": [ { "platformAppApiKey": [ ] } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "url": { "type": "string", "description": "SSO url to autenticate the user" } } } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given user does not exist" } } } }, "/api/v1/accounts/{account_id}/agent_bots": { "parameters": [ { "$ref": "#/parameters/account_id" } ], "get": { "tags": [ "Account AgentBots" ], "operationId": "list-all-account-agent-bots", "summary": "List all AgentBots", "description": "List all agent bots available for the current account", "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of agent bots", "items": [ { "$ref": "#/definitions/agent_bot" } ] } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "Account AgentBots" ], "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" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/agent_bots/{id}": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/agent_bot_id" } ], "get": { "tags": [ "Account AgentBots" ], "operationId": "get-details-of-a-single-account-agent-bot", "summary": "Get an agent bot details", "description": "Get the details of an agent bot in the account", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given agent bot ID does not exist in the account" } } }, "patch": { "tags": [ "Account AgentBots" ], "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" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Account AgentBots" ], "operationId": "delete-an-account-agent-bot", "summary": "Delete an AgentBot", "description": "Delete an AgentBot from the account", "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The agent bot does not exist in the account" } } } }, "/api/v1/accounts/{account_id}/contacts": { "get": { "tags": [ "Contact" ], "operationId": "contactList", "description": "Listing all the contacts with pagination (Page size = 15)", "summary": "List Contacts", "parameters": [ { "$ref": "#/parameters/contact_sort_param" }, { "$ref": "#/parameters/page" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/contact_list" } }, "400": { "description": "Bad Request Error", "schema": { "$ref": "#/definitions/bad_request_error" } } } }, "post": { "tags": [ "Contact" ], "operationId": "contactCreate", "description": "Create New Contact", "summary": "Create Contact", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/contact_create" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/extended_contact" } }, "400": { "description": "Bad Request Error", "schema": { "$ref": "#/definitions/bad_request_error" } } } } }, "/api/v1/accounts/{account_id}/contacts/{id}": { "get": { "tags": [ "Contact" ], "operationId": "contactDetails", "summary": "Show Contact", "parameters": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the contact", "required": true } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/extended_contact" } }, "404": { "description": "Contact not found" }, "403": { "description": "Access denied" } } }, "put": { "tags": [ "Contact" ], "operationId": "contactUpdate", "summary": "Update Contact", "parameters": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the contact", "required": true }, { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/contact_update" } } ], "responses": { "204": { "description": "Success", "schema": { "$ref": "#/definitions/contact_base" } }, "404": { "description": "Contact not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/contacts/{id}/conversations": { "get": { "tags": [ "Contact" ], "operationId": "contactConversations", "summary": "Conversations", "parameters": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the contact", "required": true } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/contact_conversations" } }, "404": { "description": "Contact not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/contacts/search": { "get": { "tags": [ "Contact" ], "operationId": "contactSearch", "description": "Search the contacts using a search key, currently supports email search (Page size = 15)", "summary": "Search Contacts", "parameters": [ { "name": "q", "in": "query", "type": "string" }, { "$ref": "#/parameters/contact_sort_param" }, { "$ref": "#/parameters/page" } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "payload": { "$ref": "#/definitions/contact_list" } } } }, "401": { "description": "Authentication error", "schema": { "$ref": "#/definitions/bad_request_error" } } } } }, "/api/v1/accounts/{account_id}/contacts/{id}/contact_inboxes": { "post": { "tags": [ "Contact" ], "operationId": "contactInboxCreation", "description": "Create a contact inbox record for an inbox", "summary": "Create contact inbox", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "inbox_id": { "type": "number", "description": "The ID of the inbox", "required": true }, "source_id": { "$ref": "#/parameters/source_id" } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/contact_inboxes" } }, "401": { "description": "Authentication error", "schema": { "$ref": "#/definitions/bad_request_error" } }, "422": { "description": "Incorrect payload" } } } }, "/api/v1/accounts/{account_id}/contacts/{id}/contactable_inboxes": { "get": { "tags": [ "Contact" ], "operationId": "contactableInboxesGet", "description": "Get List of contactable Inboxes", "summary": "Get Contactable Inboxes", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/contactable_inboxes" } }, "401": { "description": "Authentication error", "schema": { "$ref": "#/definitions/bad_request_error" } }, "422": { "description": "Incorrect payload" } } } }, "/api/v1/accounts/{account_id}/conversations": { "get": { "tags": [ "Conversation" ], "operationId": "conversationSearch", "description": "Search for conversations containing a messages with the query string", "summary": "Conversations Search", "parameters": [ { "name": "q", "in": "query", "type": "string" }, { "name": "assignee_type", "in": "query", "type": "string", "enum": [ "me", "unassigned", "all" ] }, { "name": "status", "in": "query", "type": "string", "enum": [ "open", "resolved", "bot" ] }, { "name": "page", "in": "query", "type": "integer" }, { "name": "inbox_id", "in": "query", "type": "integer" }, { "name": "labels", "in": "query", "type": "array", "items": { "type": "string" } }, { "$ref": "#/parameters/account_id" } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/conversation_list" } }, "400": { "description": "Bad Request Error", "schema": { "$ref": "#/definitions/bad_request_error" } }, "description": "Access denied" } }, "post": { "tags": [ "Conversation" ], "operationId": "newConversation", "summary": "Create New Conversation", "description": "Creating a conversation in chatwoot requires a source id. \n\n Learn more about source_id: https://github.com/chatwoot/chatwoot/wiki/Building-on-Top-of-Chatwoot:-Importing-Existing-Contacts-and-Creating-Conversations", "security": [ { "userApiKey": [ ] }, { "agentBotApiKey": [ ] } ], "parameters": [ { "$ref": "#/parameters/account_id" }, { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "source_id": { "$ref": "#/parameters/source_id" }, "inbox_id": { "type": "string", "description": "Id of inbox in which the conversation is created
Allowed Inbox Types: Website, Phone, Api, Email " }, "contact_id": { "type": "string", "description": "Contact Id for which conversation is created" }, "additional_attributes": { "type": "object", "description": "Lets you specify attributes like browser information" } } } } ], "responses": { "200": { "description": "Success", "schema": { "type": "object", "properties": { "id": { "type": "number", "description": "ID of the conversation" }, "account_id": { "type": "number", "description": "Account Id" }, "inbox_id": { "type": "number", "description": "ID of the inbox" } } } }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/conversations/{converstion_id}": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" } ], "get": { "tags": [ "Conversation" ], "operationId": "get-details-of-a-conversation", "summary": "Conversation Details", "description": "Get all details regarding a conversation with all messages in the conversation", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/conversation_show" } }, "404": { "description": "Conversation not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/conversations/{conversation_id}/toggle_status": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" } ], "post": { "tags": [ "Conversation" ], "operationId": "toggle-status-of-a-conversation", "summary": "Toggle Status", "description": "Toggles the status of the conversation between open and resolved", "security": [ { "userApiKey": [ ] }, { "agentBotApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "open", "resolved", "bot" ], "required": true, "description": "The status of the conversation" } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/conversation_status_toggle" } }, "404": { "description": "Conversation not found" }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/conversations/{conversation_id}/assignments": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" } ], "post": { "tags": [ "Conversation Assignment" ], "operationId": "assign-a-conversation", "summary": "Assign Conversation", "description": "Assign a conversation to an agent or a team", "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" } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/user" } }, "404": { "description": "Conversation not found" }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/conversations/{conversation_id}/labels": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" } ], "get": { "tags": [ "Conversation Labels" ], "operationId": "list-all-labels-of-a-conversation", "summary": "List Labels", "description": "Lists all the labels of a conversation", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/conversation_labels" } }, "404": { "description": "Conversation not found" }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "Conversation Labels" ], "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)", "properties": { "type": "string" } } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/conversation_labels" } }, "404": { "description": "Conversation not found" }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/inboxes": { "get": { "tags": [ "Inbox" ], "operationId": "listAllInboxes", "summary": "List all inboxes", "description": "List all inboxes available in the current account", "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of inboxes", "items": { "$ref": "#/definitions/inbox" } } }, "404": { "description": "Inbox not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/inboxes/": { "post": { "tags": [ "Inbox" ], "operationId": "inboxCreation", "summary": "Create an inbox", "description": "You can create more than one website inbox in each account", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the inbox" }, "avatar": { "type": "file", "description": "File for avatar image" }, "channel": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "web_widget" ] }, "website_url": { "type": "string", "description": "URL at which the widget will be loaded" }, "welcome_title": { "type": "string", "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { "type": "string", "description": "Welcome tagline to be displayed on the widget" }, "agent_away_message": { "type": "string", "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" }, "widget_color": { "type": "string", "description": "A Hex-color string used to customize the widget" } } } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/inbox" } }, "404": { "description": "Inbox not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/inboxes/{id}": { "patch": { "tags": [ "Inbox" ], "operationId": "updateInbox", "summary": "Update Inbox", "description": "Add avatar and disable auto assignment for an inbox", "parameters": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the inbox", "required": true }, { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the inbox" }, "enable_auto_assignment": { "type": "boolean", "required": true, "description": "Enable Auto Assignment" }, "avatar": { "type": "file", "required": false, "description": "Image file for avatar" }, "channel": { "type": "object", "properties": { "website_url": { "type": "string", "description": "URL at which the widget will be loaded" }, "welcome_title": { "type": "string", "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { "type": "string", "description": "Welcome tagline to be displayed on the widget" }, "agent_away_message": { "type": "string", "description": "A message which will be sent if there is not agent available. This is not available if agentbot is connected" }, "widget_color": { "type": "string", "description": "A Hex-color string used to customize the widget" } } } } } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/inbox" } }, "404": { "description": "Inbox not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/inboxes/{id}/agent_bot": { "get": { "tags": [ "Inbox" ], "operationId": "getInboxAgentBot", "summary": "Show Inbox Agent Bot", "description": "See if an agent bot is associated to the Inbox", "parameters": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the inbox", "required": true } ], "responses": { "204": { "description": "Success", "schema": { "$ref": "#/definitions/agent_bot" } }, "404": { "description": "Inbox not found, Agent bot not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/inboxes/{id}/set_agent_bot": { "post": { "tags": [ "Inbox" ], "operationId": "updateAgentBot", "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": [ { "name": "id", "in": "path", "type": "number", "description": "ID of the inbox", "required": true }, { "name": "data", "in": "body", "required": true, "schema": { "type": "object", "properties": { "agent_bot": { "type": "number", "required": true, "description": "Agent bot ID" } } } } ], "responses": { "204": { "description": "Success" }, "404": { "description": "Inbox not found, Agent bot not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/conversations/{id}/messages": { "post": { "tags": [ "Messages" ], "operationId": "conversationNewMessageAttachment", "summary": "Create New Message Attachment", "description": "Create an attachment Message", "consumes": [ "multipart/form-data" ], "security": [ { "userApiKey": [ ] }, { "agentBotApiKey": [ ] } ], "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" }, { "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": "file" } } ], "responses": { "200": { "description": "Success", "schema": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/message" } ] } }, "404": { "description": "Conversation not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/conversations/{converstion_id}/messages": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" } ], "get": { "tags": [ "Messages" ], "operationId": "list-all-messages", "summary": "Get messages", "description": "List all messages of a conversation", "responses": { "200": { "description": "Array of messages", "type": "array", "schema": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/message" } ] } }, "404": { "description": "Conversation not found" }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "Messages" ], "operationId": "create-a-new-message-in-a-conversation", "summary": "Create New Message", "description": "Create a new message in the conversation", "security": [ { "userApiKey": [ ] }, { "agentBotApiKey": [ ] } ], "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/conversation_message_create" } } ], "responses": { "200": { "description": "Success", "schema": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/message" } ] } }, "404": { "description": "Conversation not found" }, "403": { "description": "Access denied" } } } }, "/api/v1/accounts/{account_id}/conversations/{conversation_id}/messages/{message_id}": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/conversation_id" }, { "$ref": "#/parameters/message_id" } ], "delete": { "tags": [ "Messages" ], "operationId": "delete-a-message", "summary": "Delete a message", "description": "Delete a message and it's attachments from the conversation.", "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The message or conversation does not exist in the account" } } } }, "/api/v1/accounts/{account_id}/integrations/apps": { "parameters": [ { "$ref": "#/parameters/account_id" } ], "get": { "tags": [ "Integrations" ], "operationId": "get-details-of-all-integrations", "summary": "List all the Integrations", "description": "Get the details of all Integrations available for the account", "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of Integration apps", "items": { "$ref": "#/definitions/integrations_app" } } }, "401": { "description": "Unauthorized" }, "404": { "description": "Url not found" } } } }, "/api/v1/accounts/{account_id}/integrations/hooks": { "post": { "tags": [ "Integrations" ], "operationId": "create-an-integration-hook", "summary": "Create an integration hook", "description": "Create an integration hook", "parameters": [ { "$ref": "#/parameters/account_id" }, { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/integrations_hook_create_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/integrations_hook" } }, "401": { "description": "Unauthorized" } } }, "patch": { "tags": [ "Integrations" ], "operationId": "update-an-integrations-hook", "summary": "Update an Integration Hook", "description": "Update an Integration Hook", "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/hook_id" }, { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/integrations_hook_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/integrations_hook" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Integrations" ], "operationId": "delete-an-integration-hook", "summary": "Delete an Integration Hook", "description": "Delete an Integration Hook", "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/hook_id" } ], "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The hook does not exist in the account" } } } }, "/profile": { "get": { "tags": [ "Profile" ], "operationId": "fetchProfile", "summary": "Fetch user profile", "description": "Get the user profile details", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/teams": { "parameters": [ { "$ref": "#/parameters/account_id" } ], "get": { "tags": [ "Teams" ], "operationId": "list-all-teams", "summary": "List all teams", "description": "List all teams available in the current account", "responses": { "200": { "description": "Success", "schema": { "type": "array", "description": "Array of teams", "items": { "$ref": "#/definitions/team" } } }, "401": { "description": "Unauthorized" } } }, "post": { "tags": [ "Teams" ], "operationId": "create-a-team", "summary": "Create a team", "description": "Create a team in the account", "parameters": [ { "$ref": "#/parameters/account_id" }, { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/team_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/team" } }, "401": { "description": "Unauthorized" } } } }, "/api/v1/accounts/{account_id}/teams/{id}": { "parameters": [ { "$ref": "#/parameters/account_id" }, { "$ref": "#/parameters/team_id" } ], "get": { "tags": [ "Teams" ], "operationId": "get-details-of-a-single-team", "summary": "Get a team details", "description": "Get the details of a team in the account", "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/team" } }, "401": { "description": "Unauthorized" }, "404": { "description": "The given team ID does not exist in the account" } } }, "patch": { "tags": [ "Teams" ], "operationId": "update-a-team", "summary": "Update a team", "description": "Update a team's attributes", "parameters": [ { "name": "data", "in": "body", "required": true, "schema": { "$ref": "#/definitions/team_create_update_payload" } } ], "responses": { "200": { "description": "Success", "schema": { "$ref": "#/definitions/team" } }, "401": { "description": "Unauthorized" } } }, "delete": { "tags": [ "Teams" ], "operationId": "delete-a-team", "summary": "Delete a team", "description": "Delete a team from the account", "responses": { "200": { "description": "Success" }, "401": { "description": "Unauthorized" }, "404": { "description": "The team does not exist in the account" } } } } }, "definitions": { "bad_request_error": { "title": "data", "type": "object", "properties": { "description": { "type": "string" }, "errors": { "type": "array", "items": { "$ref": "#/definitions/request_error" } } } }, "request_error": { "type": "object", "properties": { "field": { "type": "string" }, "message": { "type": "string" }, "code": { "type": "string" } } }, "generic_id": { "type": "object", "properties": { "id": { "type": "number" } } }, "contact": { "type": "object", "properties": { "email": { "type": "string", "description": "Email address of the contact" }, "name": { "type": "string", "description": "The name of the contact" }, "phone_number": { "type": "string", "description": "Phone number of the contact" }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, "additional_attributes": { "type": "object", "description": "The object containing additional attributes related to the contact" }, "contact_inboxes": { "type": "array", "items": { "$ref": "#/definitions/contact_inboxes" } } } }, "conversation": { "type": "object", "properties": { "id": { "type": "number", "description": "ID of the conversation" }, "messages": { "type": "array" }, "account_id": { "type": "number", "description": "Account Id" }, "inbox_id": { "type": "number", "description": "ID of the inbox" }, "status": { "type": "string", "enum": [ "open", "resolved", "bot" ], "description": "The status of the conversation" }, "timestamp": { "type": "string", "description": "The time at which conversation was created" }, "contact_last_seen_at": { "type": "string" }, "agent_last_seen_at": { "type": "agent_last_seen_at" }, "unread_count": { "type": "number", "description": "The number of unread messages" }, "additional_attributes": { "type": "object", "description": "The object containing additional attributes related to the conversation" } } }, "message": { "type": "object", "properties": { "content": { "type": "string", "description": "The text content of the message" }, "content_type": { "type": "string", "enum": [ "text", "input_select", "cards", "form" ], "description": "The type of the template message" }, "content_attributes": { "type": "object", "description": "The content attributes for each content_type" }, "message_type": { "type": "string", "enum": [ "incoming", "outgoing", "activity", "template" ], "description": "The type of the message" }, "created_at": { "type": "integer", "description": "The time at which message was created" }, "private": { "type": "boolean", "description": "The flags which shows whether the message is private or not" }, "attachment": { "type": "object", "description": "The file object attached to the image" }, "sender": { "type": "object", "description": "User/Agent/AgentBot object" }, "conversation_id": { "type": "number", "description": "ID of the conversation" } } }, "user": { "type": "object", "properties": { "id": { "type": "number" }, "uid": { "type": "string" }, "name": { "type": "string" }, "available_name": { "type": "string" }, "display_name": { "type": "string" }, "email": { "type": "string" }, "account_id": { "type": "number" }, "role": { "type": "string", "enum": [ "agent", "administrator" ] }, "confirmed": { "type": "boolean" }, "accounts": { "type": "array", "items": { "$ref": "#/definitions/account" } } } }, "inbox": { "type": "object", "properties": { "id": { "type": "number", "description": "ID of the inbox" }, "name": { "type": "string", "description": "The name of the inbox" }, "website_url": { "type": "string", "description": "Website URL" }, "channel_type": { "type": "string", "description": "The type of the inbox" }, "avatar_url": { "type": "string", "description": "The avatar image of the inbox" }, "widget_color": { "type": "string", "description": "Widget Color used for customization of the widget" }, "website_token": { "type": "string", "description": "Website Token" }, "enable_auto_assignment": { "type": "boolean", "description": "The flag which shows whether Auto Assignment is enabled or not" }, "web_widget_script": { "type": "string", "description": "Script used to load the website widget" }, "welcome_title": { "type": "string", "description": "Welcome title to be displayed on the widget" }, "welcome_tagline": { "type": "string", "description": "Welcome tagline to be displayed on the widget" }, "greeting_enabled": { "type": "boolean", "description": "The flag which shows whether greeting is enabled" }, "greeting_message": { "type": "string", "description": "A greeting message when the user starts the conversation" } } }, "agent_bot": { "type": "object", "properties": { "id": { "type": "number", "description": "ID of the agent bot" }, "name": { "type": "string", "description": "The name of the agent bot" }, "description": { "type": "string", "description": "The description about the agent bot" }, "account_id": { "type": "number", "description": "Account ID if it's an account specific bot" }, "outgoing_url": { "type": "string", "description": "The webhook URL for the bot" } } }, "contact_inboxes": { "type": "object", "properties": { "source_id": { "type": "string", "description": "Contact Inbox Source Id" }, "inbox": { "$ref": "#/definitions/inbox" } } }, "contactable_inboxes": { "type": "object", "properties": { "source_id": { "type": "string", "description": "Contact Inbox Source Id" }, "inbox": { "$ref": "#/definitions/inbox" } } }, "account": { "type": "object", "properties": { "id": { "type": "number", "description": "Account ID" }, "name": { "type": "string", "description": "Name of the account" }, "role": { "type": "string", "enum": [ "administrator", "agent" ], "description": "The user role in the account" } } }, "platform_account": { "type": "object", "properties": { "id": { "type": "number", "description": "Account ID" }, "name": { "type": "string", "description": "Name of the account" } } }, "team": { "type": "object", "properties": { "id": { "type": "number", "description": "The ID of the team" }, "name": { "type": "string", "description": "The name of the team" }, "description": { "type": "string", "description": "The description about the team" }, "allow_auto_assign": { "type": "boolean", "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" }, "account_id": { "type": "number", "description": "The ID of the account with the team is a part of" }, "is_member": { "type": "boolean", "description": "This field shows whether the current user is a part of the team" } } }, "integrations_app": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the integration" }, "name": { "type": "string", "description": "The name of the integration" }, "description": { "type": "string", "description": "The description about the team" }, "hook_type": { "type": "string", "description": "Whether the integration is an account or inbox integration" }, "enabled": { "type": "boolean", "description": "Whether the integration is enabled for the account" }, "allow_multiple_hooks": { "type": "boolean", "description": "Whether multiple hooks can be created for the integration" }, "hooks": { "type": "array", "description": "If there are any hooks created for this integration" } } }, "integrations_hook": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID of the integration hook" }, "app_id": { "type": "string", "description": "The ID of the integration app" }, "inbox_id": { "type": "string", "description": "Inbox ID if its an Inbox integration" }, "account_id": { "type": "string", "description": "Account ID of the integration" }, "status": { "type": "boolean", "description": "Whether the integration hook is enabled for the account" }, "hook_type": { "type": "boolean", "description": "Whether its an account or inbox integration hook" }, "settings": { "type": "object", "description": "The associated settings for the integration" } } }, "extended_contact": { "allOf": [ { "$ref": "#/definitions/contact" }, { "type": "object", "properties": { "id": { "type": "number", "description": "Id of the user" }, "availability_status": { "type": "string", "enum": [ "online", "offline" ], "description": "Availability status of the user" } } } ] }, "contact_base": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/contact" } ] }, "contact_list": { "type": "array", "description": "array of contacts", "items": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/contact" } ] } }, "contact_conversations": { "type": "array", "description": "array of conversations", "items": { "allOf": [ { "$ref": "#/definitions/conversation" }, { "type": "object", "properties": { "meta": { "type": "object", "properties": { "sender": { "type": "object", "properties": { "id": { "type": "number", "description": "ID fo the sender" }, "name": { "type": "string", "description": "The name of the sender" }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, "channel": { "type": "string", "description": "Channel Type" } } }, "assignee": { "$ref": "#/definitions/user" } } } } }, { "type": "object", "properties": { "display_id": { "type": "number" } } } ] } }, "conversation_list": { "type": "object", "properties": { "data": { "type": "object", "properties": { "meta": { "type": "object", "properties": { "mine_count": { "type": "number" }, "unassigned_count": { "type": "number" }, "all_count": { "type": "number" } } }, "payload": { "type": "array", "description": "array of conversations", "items": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/conversation" }, { "type": "object", "properties": { "meta": { "type": "object", "properties": { "sender": { "type": "object", "properties": { "id": { "type": "number", "description": "ID fo the sender" }, "name": { "type": "string", "description": "The name of the sender" }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, "channel": { "type": "string", "description": "Channel Type" } } }, "assignee": { "$ref": "#/definitions/user" } } } } } ] } } } } } }, "conversation_show": { "type": "object", "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/conversation" }, { "type": "object", "properties": { "meta": { "type": "object", "properties": { "sender": { "type": "object", "properties": { "id": { "type": "number", "description": "ID fo the sender" }, "name": { "type": "string", "description": "The name of the sender" }, "thumbnail": { "type": "string", "description": "Avatar URL of the contact" }, "channel": { "type": "string", "description": "Channel Type" } } }, "assignee": { "$ref": "#/definitions/user" } } } } } ] }, "conversation_status_toggle": { "type": "object", "properties": { "meta": { "type": "object" }, "payload": { "type": "object", "properties": { "success": { "type": "boolean" }, "current_status": { "type": "string", "enum": [ "open", "resolved" ] }, "conversation_id": { "type": "number" } } } } }, "conversation_labels": { "type": "object", "properties": { "payload": { "type": "array", "description": "Array of labels", "items": { "type": "string" } } } }, "extended_message": { "allOf": [ { "$ref": "#/definitions/generic_id" }, { "$ref": "#/definitions/message" }, { "type": "object", "properties": { "source_id": { "type": "number" }, "sender": { "type": "object" } } } ] }, "account_create_update_payload": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the account" } } }, "agent_bot_create_update_payload": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the agent bot" }, "description": { "type": "string", "description": "The description about the agent bot" }, "outgoing_url": { "type": "string", "description": "The webhook URL for the bot" } } }, "user_create_update_payload": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the account" } } }, "contact_create": { "type": "object", "properties": { "inbox_id": { "type": "number", "required": true }, "name": { "type": "string" }, "email": { "type": "string" }, "phone_number": { "type": "string" } } }, "contact_update": { "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "phone_number": { "type": "string" } } }, "conversation_message_create": { "type": "object", "properties": { "content": { "type": "string", "description": "The content of the message", "required": true }, "message_type": { "type": "string", "enum": [ "outgoing", "incoming" ] }, "private": { "type": "boolean", "description": "Flag to identify if it is a private note" }, "content_type": { "type": "string", "enum": [ "input_email", "cards", "input_select", "form", "article" ], "example": "cards", "description": "if you want to create custom message types" }, "content_attributes": { "type": "object", "description": "attributes based on your content type" } } }, "team_create_update_payload": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the team" }, "description": { "type": "string", "description": "The description of the team" }, "allow_auto_assign": { "type": "boolean", "description": "If this setting is turned on, the system would automatically assign the conversation to an agent in the team while assigning the conversation to a team" } } }, "integrations_hook_create_payload": { "type": "object", "properties": { "app_id": { "type": "string", "description": "The ID of app for which integration hook is being created" }, "inbox_id": { "type": "string", "description": "The inbox ID, if the hook is an inbox hook" }, "settings": { "type": "object", "description": "The settings required by the integration" } } }, "integrations_hook_update_payload": { "type": "object", "properties": { "settings": { "type": "object", "description": "The settings required by the integration" } } } }, "parameters": { "account_id": { "in": "path", "name": "account_id", "schema": { "type": "integer" }, "required": true, "description": "The numeric ID of the account" }, "agent_bot_id": { "in": "path", "name": "id", "schema": { "type": "integer" }, "required": true, "description": "The ID of the agentbot to be updated" }, "team_id": { "in": "path", "name": "id", "schema": { "type": "integer" }, "required": true, "description": "The ID of the team to be updated" }, "hook_id": { "in": "path", "name": "hook_id", "schema": { "type": "integer" }, "required": true, "description": "The numeric ID of the integration hook" }, "source_id": { "type": "string", "description": "Id of the session for which the conversation is created.\n\n\n\n Source Ids can be obtained through contactable inboxes API or via generated.

Website: Chatwoot generated string which can be obtained from webhook events.
Phone Channels(Twilio): Phone number in e164 format
Email Channels: Contact Email address
API Channel: Any Random String" }, "conversation_id": { "in": "path", "name": "conversation_id", "schema": { "type": "integer" }, "required": true, "description": "The numeric ID of the conversation" }, "message_id": { "in": "path", "name": "message_id", "schema": { "type": "integer" }, "required": true, "description": "The numeric ID of the message" }, "contact_sort_param": { "in": "query", "name": "sort", "schema": { "type": "string", "enum": [ "name", "email", "phone_number", "last_activity_at", "-name", "-email", "-phone_number", "-last_activity_at" ] }, "required": false, "description": "The attribute by which list should be sorted" }, "page": { "in": "query", "name": "page", "schema": { "type": "integer", "default": 1 }, "required": false, "description": "The page parameter" }, "platform_user_id": { "in": "path", "name": "id", "schema": { "type": "integer" }, "required": true, "description": "The numeric ID of the user on the platform" } }, "x-tagGroups": [ { "name": "Platform", "tags": [ "Accounts", "Account Users", "AgentBots", "Users" ] }, { "name": "Application", "tags": [ "Account AgentBots", "Contact", "Conversation", "Conversation Assignment", "Conversation Labels", "Inbox", "Messages", "Integrations", "Profile", "Teams" ] } ] }