{ "openapi": "3.0.0", "paths": { "/conversations/search": { "get": { "operationId": "search-conversation", "summary": "Search Conversations", "description": "Returns a list of all conversations matching the search criteria along with the sort and filter options selected.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "query", "description": "Location Id", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "string" } }, { "name": "contactId", "required": false, "in": "query", "description": "Contact Id", "schema": { "example": "9VEmS0si86GW6gXWU89b", "type": "string" } }, { "name": "assignedTo", "required": false, "in": "query", "description": "User IDs that conversations are assigned to. Multiple IDs can be provided as comma-separated values. Use \"unassigned\" to fetch conversations not assigned to any user.", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik", "type": "string" } }, { "name": "followers", "required": false, "in": "query", "description": "User IDs of followers to filter conversations by. Multiple IDs can be provided as comma-separated values.", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik", "type": "string" } }, { "name": "mentions", "required": false, "in": "query", "description": "User Id of the mention. Multiple values are comma separated.", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik", "type": "string" } }, { "name": "query", "required": false, "in": "query", "description": "Search paramater as a string", "schema": { "example": "Search string", "type": "string" } }, { "name": "sort", "required": false, "in": "query", "description": "Sort paramater - asc or desc", "schema": { "example": "asc", "enum": [ "asc", "desc" ], "type": "string" } }, { "name": "startAfterDate", "required": false, "in": "query", "description": "Search to begin after the specified date - should contain the sort value of the last document", "anyOf": [ { "$ref": "#/components/schemas/StartAfterNumberSchema" }, { "$ref": "#/components/schemas/StartAfterArrayNumberSchema" } ], "schema": { "example": 1600854, "type": "any" } }, { "name": "id", "required": false, "in": "query", "description": "Id of the conversation", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "string" } }, { "name": "limit", "required": false, "in": "query", "description": "Limit of conversations - Default is 20", "schema": { "example": 20, "type": "number" } }, { "name": "lastMessageType", "required": false, "in": "query", "description": "Type of the last message in the conversation as a string", "schema": { "example": "TYPE_SMS", "enum": [ "TYPE_CALL", "TYPE_SMS", "TYPE_RCS", "TYPE_EMAIL", "TYPE_SMS_REVIEW_REQUEST", "TYPE_WEBCHAT", "TYPE_SMS_NO_SHOW_REQUEST", "TYPE_CAMPAIGN_SMS", "TYPE_CAMPAIGN_CALL", "TYPE_CAMPAIGN_EMAIL", "TYPE_CAMPAIGN_VOICEMAIL", "TYPE_FACEBOOK", "TYPE_CAMPAIGN_FACEBOOK", "TYPE_CAMPAIGN_MANUAL_CALL", "TYPE_CAMPAIGN_MANUAL_SMS", "TYPE_GMB", "TYPE_CAMPAIGN_GMB", "TYPE_REVIEW", "TYPE_INSTAGRAM", "TYPE_WHATSAPP", "TYPE_CUSTOM_SMS", "TYPE_CUSTOM_EMAIL", "TYPE_CUSTOM_PROVIDER_SMS", "TYPE_CUSTOM_PROVIDER_EMAIL", "TYPE_IVR_CALL", "TYPE_ACTIVITY_CONTACT", "TYPE_ACTIVITY_INVOICE", "TYPE_ACTIVITY_PAYMENT", "TYPE_ACTIVITY_OPPORTUNITY", "TYPE_LIVE_CHAT", "TYPE_LIVE_CHAT_INFO_MESSAGE", "TYPE_ACTIVITY_APPOINTMENT", "TYPE_FACEBOOK_COMMENT", "TYPE_INSTAGRAM_COMMENT", "TYPE_CUSTOM_CALL", "TYPE_INTERNAL_COMMENT", "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG", "TYPE_TIKTOK", "TYPE_TIKTOK_COMMENT", "TYPE_ACTIVITY_WHATSAPP", "TYPE_FORM_SUBMISSION", "TYPE_SMS_REACTION" ], "type": "string" } }, { "name": "lastMessageAction", "required": false, "in": "query", "description": "Action of the last outbound message in the conversation as string.", "schema": { "example": "manual", "enum": [ "automated", "manual" ], "type": "string" } }, { "name": "lastMessageDirection", "required": false, "in": "query", "description": "Direction of the last message in the conversation as string.", "schema": { "example": "inbound", "enum": [ "inbound", "outbound" ], "type": "string" } }, { "name": "status", "required": false, "in": "query", "description": "The status of the conversation to be filtered - all, read, unread, starred ", "schema": { "example": "all", "enum": [ "all", "read", "unread", "starred", "recents" ], "type": "string" } }, { "name": "sortBy", "required": false, "in": "query", "description": "The sorting of the conversation to be filtered as - manual messages or all messages", "schema": { "example": "last_message_date", "enum": [ "last_manual_message_date", "last_message_date", "score_profile", "overdue_at", "due_at" ], "type": "string" } }, { "name": "sortScoreProfile", "required": false, "in": "query", "description": "Id of score profile on which sortBy.ScoreProfile should sort on", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "string" } }, { "name": "scoreProfile", "required": false, "in": "query", "description": "Id of score profile on which conversations should get filtered out, works with scoreProfileMin & scoreProfileMax", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "string" } }, { "name": "scoreProfileMin", "required": false, "in": "query", "description": "Minimum value for score", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "number" } }, { "name": "scoreProfileMax", "required": false, "in": "query", "description": "Maximum value for score", "schema": { "example": "ABCHkzuJQ8ZMd4Te84GK", "type": "number" } }, { "name": "startDate", "required": false, "in": "query", "description": "Start date filter for dateAdded field (Unix timestamp in milliseconds)", "schema": { "example": 1640995200000, "type": "number" } }, { "name": "endDate", "required": false, "in": "query", "description": "End date filter for dateAdded field (Unix timestamp in milliseconds)", "schema": { "example": 1672531199000, "type": "number" } } ], "responses": { "200": { "description": "Successfully fetched the conversations", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendConversationResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Search" ], "security": [ { "bearer": [ "conversations.readonly" ] } ] } }, "/conversations/{conversationId}": { "get": { "operationId": "get-conversation", "summary": "Get Conversation", "description": "Get the conversation details based on the conversation ID", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "conversationId", "required": true, "in": "path", "description": "Conversation ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetConversationByIdResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Conversations" ], "security": [ { "bearer": [ "conversations.readonly" ] } ] }, "put": { "operationId": "update-conversation", "summary": "Update Conversation", "description": "Update the conversation details based on the conversation ID", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "conversationId", "required": true, "in": "path", "description": "Conversation ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateConversationDto" } } } }, "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetConversationSuccessfulResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Conversations" ], "security": [ { "bearer": [ "conversations.write" ] } ] }, "delete": { "operationId": "delete-conversation", "summary": "Delete Conversation", "description": "Delete the conversation details based on the conversation ID", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "conversationId", "required": true, "in": "path", "description": "Conversation ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "responses": { "200": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeleteConversationSuccessfulResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Conversations" ], "security": [ { "bearer": [ "conversations.write" ] } ] } }, "/conversations/preferences/custom-subtypes": { "get": { "operationId": "get-all-custom-subtypes", "summary": "Get All Custom Subtypes", "description": "Get all custom subtypes for a location", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "query", "description": "Location Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "responses": { "200": { "description": "" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Preference Management" ] }, "post": { "operationId": "create-custom-subtype", "summary": "Create Custom Subtype", "description": "Create a new custom subtype for a location. Requires agency or account admin role.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "query", "description": "Location Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateCustomSubtypeDto" } } } }, "responses": { "200": { "description": "Successful response" }, "201": { "description": "" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Preference Management" ] } }, "/conversations/preferences/custom-subtypes/{id}": { "put": { "operationId": "update-custom-subtype", "summary": "Update Custom Subtype", "description": "Update or archive a custom subtype. Requires agency or account admin role.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "id", "required": true, "in": "path", "description": "Custom Subtype Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } }, { "name": "locationId", "required": true, "in": "query", "description": "Location Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateCustomSubtypeDto" } } } }, "responses": { "200": { "description": "" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Preference Management" ] } }, "/conversations/preferences/unsubscriptions/status": { "get": { "operationId": "get-contact-unsubscription-status", "summary": "Get Contact Unsubscription Status", "description": "Get all subscription statuses for a contact (all emails or specific email)", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "query", "description": "Location Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } }, { "name": "contactId", "required": true, "in": "query", "description": "Contact Id", "schema": { "example": "OP7z4LCyPACyH5fcEIZa", "type": "string" } }, { "name": "email", "required": false, "in": "query", "description": "Email address (optional - if not provided, gets all emails for contact)", "schema": { "example": "user@example.com", "type": "string" } } ], "responses": { "200": { "description": "" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Preference Management" ] } }, "/conversations/preferences/unsubscriptions/user-change": { "post": { "operationId": "user-subscription-change", "summary": "User Subscription Change", "description": "Process subscription change initiated by a user (admin/agent). Supports individual custom subscription changes and resub all functionality. Legal forms are automatically created for user-initiated resubscribe actions on custom subscriptions.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserSubscriptionChangeDto" } } } }, "responses": { "200": { "description": "Successful response" }, "201": { "description": "" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Preference Management" ] } }, "/conversations/messages/email/{id}": { "get": { "operationId": "get-email-by-id", "summary": "Get email by Id", "description": "Get email by Id", "parameters": [], "responses": { "200": { "description": "Email object for the id given.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetEmailMessageResponseDto" } } } } }, "tags": [ "Email" ] } }, "/conversations/messages/email/{emailMessageId}/schedule": { "delete": { "operationId": "cancel-scheduled-email-message", "summary": "Cancel a scheduled email message.", "description": "Post the messageId for the API to delete a scheduled email message.
", "parameters": [ { "name": "emailMessageId", "required": true, "in": "path", "description": "Email Message Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "responses": { "200": { "description": "The scheduled email message was cancelled successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelScheduledResponseDto" } } } } }, "tags": [ "Email" ] } }, "/conversations/messages/export": { "get": { "operationId": "export-messages-by-location", "summary": "Export messages by location ID", "description": "Export messages for a specific location with cursor-based pagination support. Response includes messageType (string), source, and subType fields. The channel parameter is optional - if not provided, all non-email message types will be returned including activity messages (opportunity updates, appointments, etc.).", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "query", "description": "Location ID to filter messages by", "schema": { "type": "string" } }, { "name": "limit", "required": false, "in": "query", "description": "Number of messages to return per page", "schema": { "minimum": 10, "maximum": 500, "default": 100, "type": "number" } }, { "name": "cursor", "required": false, "in": "query", "description": "Cursor for pagination. Pass the nextCursor from previous response to get next page.", "schema": { "example": "eyJwaXRJZCI6ImFiYy0xMjMiLCJsYXN0U29ydCI6WzE2NDY4NjQ0MDBdLCJsYXN0SWQiOiIxMjMifQ==", "type": "string" } }, { "name": "sortBy", "required": false, "in": "query", "description": "Field to sort by", "schema": { "default": "createdAt", "enum": [ "createdAt", "updatedAt" ], "type": "string" } }, { "name": "sortOrder", "required": false, "in": "query", "description": "Sort order", "schema": { "default": "desc", "enum": [ "asc", "desc" ], "type": "string" } }, { "name": "conversationId", "required": false, "in": "query", "description": "Filter messages by conversation ID", "schema": { "type": "string" } }, { "name": "contactId", "required": false, "in": "query", "description": "Filter messages by contact ID", "schema": { "type": "string" } }, { "name": "channel", "required": false, "in": "query", "description": "Filter by message channel. If not provided, all non-email message types will be returned including activity messages (opportunity updates, appointments, etc.)", "schema": { "enum": [ "Call", "SMS", "Email", "WhatsApp", "Instagram", "Facebook" ], "type": "string" } }, { "name": "startDate", "required": false, "in": "query", "description": "Start date to filter messages by", "schema": { "type": "string" } }, { "name": "endDate", "required": false, "in": "query", "description": "End date to filter messages by", "schema": { "type": "string" } } ], "responses": { "200": { "description": "List of messages for the location with pagination details.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExportMessagesResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] } ] } }, "/conversations/messages/{id}": { "get": { "operationId": "get-message", "summary": "Get message by message id", "description": "Get message by message id.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "responses": { "200": { "description": "Message object for the id given.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] } ] } }, "/conversations/{conversationId}/messages": { "get": { "operationId": "get-messages", "summary": "Get messages by conversation id", "description": "Get messages by conversation id.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "conversationId", "required": true, "in": "path", "description": "Conversation ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } }, { "name": "lastMessageId", "required": false, "in": "query", "description": "Message ID of the last message in the list as a string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } }, { "name": "limit", "required": false, "in": "query", "description": "Number of messages to be fetched from the conversation. Default limit is 20", "schema": { "example": 20, "type": "number" } }, { "name": "type", "required": false, "in": "query", "description": "Types of message to fetched separated with comma", "schema": { "example": "TYPE_SMS,TYPE_CALL", "enum": [ "TYPE_CALL", "TYPE_SMS", "TYPE_RCS", "TYPE_EMAIL", "TYPE_FACEBOOK", "TYPE_GMB", "TYPE_INSTAGRAM", "TYPE_WHATSAPP", "TYPE_ACTIVITY_APPOINTMENT", "TYPE_ACTIVITY_CONTACT", "TYPE_ACTIVITY_INVOICE", "TYPE_ACTIVITY_PAYMENT", "TYPE_ACTIVITY_OPPORTUNITY", "TYPE_LIVE_CHAT", "TYPE_INTERNAL_COMMENTS", "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG", "TYPE_TIKTOK", "TYPE_ACTIVITY_WHATSAPP", "TYPE_FORM_SUBMISSION" ], "type": "string" } } ], "responses": { "200": { "description": "List of messages for the conversation id of the given type.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetMessagesByConversationResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] } ] } }, "/conversations/messages": { "post": { "operationId": "send-a-new-message", "summary": "Send a new message", "description": "Post the necessary fields for the API to send a new message.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageBodyDto" } } } }, "responses": { "200": { "description": "Created the message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/inbound": { "post": { "operationId": "add-an-inbound-message", "summary": "Add an inbound message", "description": "Post the necessary fields for the API to add a new inbound message.
", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProcessMessageBodyDto" } } } }, "responses": { "200": { "description": "Created the message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProcessMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/outbound": { "post": { "operationId": "add-an-outbound-message", "summary": "Add an external outbound call", "description": "Post the necessary fields for the API to add a new outbound call.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProcessOutboundMessageBodyDto" } } } }, "responses": { "200": { "description": "Created the message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ProcessMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/review-reply": { "post": { "operationId": "send-review-reply", "summary": "Send a review reply to Google My Business", "description": "Post a reply to a customer review on Google My Business", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendReviewReplyDto" } } } }, "responses": { "200": { "description": "Review reply sent successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/{messageId}/schedule": { "delete": { "operationId": "cancel-scheduled-message", "summary": "Cancel a scheduled message.", "description": "Post the messageId for the API to delete a scheduled message.
", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "messageId", "required": true, "in": "path", "description": "Message Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "responses": { "200": { "description": "The scheduled message was cancelled successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CancelScheduledResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/upload": { "post": { "operationId": "upload-file-attachments", "summary": "Upload file attachments", "description": "Post the necessary fields for the API to upload files. The files need to be a buffer with the key \"fileAttachment\".

The allowed file types are:


The API will return an object with the URLs", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "multipart/form-data": { "schema": { "$ref": "#/components/schemas/UploadFilesDto" } } } }, "responses": { "200": { "description": "Uploaded the file successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadFilesResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } }, "413": { "description": "Payload Too Large", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadFilesErrorResponseDto" } } } }, "415": { "description": "Unsupported Media Type", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UploadFilesErrorResponseDto" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/upload/initiate": { "post": { "operationId": "initiate-file-upload", "summary": "Initiate file upload to GCS", "description": "Generates a signed URL for direct file upload to Google Cloud Storage. Returns a signed URL valid for 15 minutes. Upload file via PUT request, then call /complete to finalize.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiateFileUploadDto" } } } }, "responses": { "200": { "description": "Signed URL generated successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InitiateFileUploadResponseDto" } } } }, "400": { "description": "Bad Request - Invalid parameters" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } }, "413": { "description": "File size exceeds maximum allowed limit" } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/upload/complete": { "post": { "operationId": "complete-file-upload", "summary": "Complete file upload", "description": "Validates the uploaded file in GCS and returns the public URL. Call this endpoint after successfully uploading the file to the signed URL.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompleteFileUploadDto" } } } }, "responses": { "200": { "description": "Upload completed successfully", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CompleteFileUploadResponseDto" } } } }, "400": { "description": "Bad Request - Invalid parameters" }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } }, "404": { "description": "File not found in storage - upload may have failed or URL expired" } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/{messageId}/status": { "put": { "operationId": "update-message-status", "summary": "Update message status", "description": "Post the necessary fields for the API to update message status.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "messageId", "required": true, "in": "path", "description": "Message Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UpdateMessageStatusDto" } } } }, "responses": { "200": { "description": "Created the message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SendMessageResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/{messageId}/attachments": { "put": { "operationId": "add-message-attachments", "summary": "Add message attachments", "description": "Set attachments on an existing message (replaces existing). Maximum 5 URLs. Supported for TYPE_CUSTOM_CALL (34) and TYPE_CALL (1) with subType EXTERNAL_CALL.", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "messageId", "required": true, "in": "path", "description": "Message Id", "schema": { "example": "ve9EPM428h8vShlRW1KT", "type": "string" } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AddMessageAttachmentsDto" } } } }, "responses": { "200": { "description": "Successfully set message attachments" }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } }, "403": { "description": "Message type does not support attachment updates" }, "404": { "description": "Message not found" } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.write" ] } ] } }, "/conversations/messages/{messageId}/locations/{locationId}/recording": { "get": { "operationId": "get-message-recording", "summary": "Get Recording by Message ID", "description": "Get the recording for a message by passing the message id", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "path", "description": "Location ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } }, { "name": "messageId", "required": true, "in": "path", "description": "Message ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "responses": { "200": { "description": "Gives the attached recording to the message", "headers": { "Content-Type": { "description": "audio/x-wav" }, "Content-Disposition": { "description": "Attachment; filename=audio.wav" } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] }, { "Location-Access": [ "conversations/message.readonly" ] } ] } }, "/conversations/locations/{locationId}/messages/{messageId}/transcription": { "get": { "operationId": "get-message-transcription", "summary": "Get transcription by Message ID", "description": "Get the recording transcription for a message by passing the message id", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "path", "description": "Location ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } }, { "name": "messageId", "required": true, "in": "path", "description": "Message ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "responses": { "200": { "description": "Gives the attached recording transcription to the message", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/GetMessageTranscriptionResponseDto" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] }, { "Location-Access": [ "conversations/message.readonly" ] } ] } }, "/conversations/locations/{locationId}/messages/{messageId}/transcription/download": { "get": { "operationId": "download-message-transcription", "summary": "Download transcription by Message ID", "description": "Download the recording transcription for a message by passing the message id", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } }, { "name": "locationId", "required": true, "in": "path", "description": "Location ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } }, { "name": "messageId", "required": true, "in": "path", "description": "Message ID as string", "schema": { "example": "tDtDnQdgm2LXpyiqYvZ6", "type": "string" } } ], "responses": { "200": { "description": "Downloads the attached transcription of the message", "headers": { "Content-Type": { "description": "text/plain" }, "Content-Disposition": { "description": "Attachment; filename=\"transcription.txt\"" } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Messages" ], "security": [ { "bearer": [ "conversations/message.readonly" ] }, { "Location-Access": [ "conversations/message.readonly" ] } ] } }, "/conversations/providers/live-chat/typing": { "post": { "operationId": "live-chat-agent-typing", "summary": "Agent/Ai-Bot is typing a message indicator for live chat", "description": "Agent/AI-Bot will call this when they are typing a message in live chat message", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserTypingBody" } } } }, "responses": { "201": { "description": "Show typing indicator for live chat", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateLiveChatMessageFeedbackResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } }, "422": { "description": "Unprocessable Entity", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnprocessableDTO" } } } } }, "tags": [ "Providers" ], "security": [ { "Location-Access": [ "conversations/livechat.write" ] } ] } }, "/conversations/": { "post": { "operationId": "create-conversation", "summary": "Create Conversation", "description": "Creates a new conversation with the data provided", "parameters": [ { "name": "Version", "in": "header", "description": "API Version", "required": true, "schema": { "type": "string", "enum": [ "2021-04-15" ] } } ], "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateConversationDto" } } } }, "responses": { "201": { "description": "Successful response", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateConversationSuccessResponse" } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/BadRequestDTO" } } } }, "401": { "description": "Unauthorized", "content": { "application/json": { "schema": { "$ref": "../common/common-schemas.json#/components/schemas/UnauthorizedDTO" } } } } }, "tags": [ "Conversations" ], "security": [ { "bearer": [ "conversations.write" ] } ] } } }, "info": { "title": "Conversations API", "description": "Documentation for Conversations API", "version": "1.0", "contact": {} }, "tags": [ { "name": "Conversations", "description": "Documentation for Conversations API" }, { "name": "Search", "description": "Documentation for Conversations API" }, { "name": "Preference Management", "description": "Documentation for Conversations API" }, { "name": "Email", "description": "Documentation for Conversations API" }, { "name": "Messages", "description": "Documentation for Conversations API" }, { "name": "Providers", "description": "Documentation for Conversations API" } ], "servers": [ { "url": "https://services.leadconnectorhq.com" } ], "components": { "securitySchemes": { "bearer": { "scheme": "bearer", "bearerFormat": "JWT", "name": "Authorization", "in": "header", "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.", "type": "http" }, "Location-Access": { "scheme": "bearer", "bearerFormat": "JWT", "name": "Authorization", "in": "header", "description": "Use the Access Token generated with user type as Sub-Account (OR) Private Integration Token of Sub-Account.", "type": "http" }, "Location-Access-Only": { "scheme": "bearer", "bearerFormat": "JWT", "name": "Authorization", "in": "header", "description": "Use the Access Token generated with user type as Sub-Account.", "type": "http" }, "Agency-Access": { "scheme": "bearer", "bearerFormat": "JWT", "name": "Authorization", "in": "header", "description": "Use the Access Token generated with user type as Agency (OR) Private Integration Token of Agency.", "type": "http" }, "Agency-Access-Only": { "scheme": "bearer", "bearerFormat": "JWT", "name": "Authorization", "in": "header", "description": "Use the Access Token generated with user type as Agency.", "type": "http" } }, "schemas": { "StartAfterNumberSchema": { "type": "object", "properties": { "startAfterDate": { "type": "number", "description": "Search to begin after the specified date - should contain the sort value of the last document", "example": 1600854 } } }, "StartAfterArrayNumberSchema": { "type": "object", "properties": { "startAfterDate": { "description": "Search to begin after the specified date - should contain the sort value of the last document", "example": [ 1600854, 1600851 ], "type": "array", "items": { "type": "string" } } } }, "ConversationSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "Conversation Id", "example": "ABCHkzuJQ8ZMd4Te84GK" }, "contactId": { "type": "string", "description": "Contact Id", "example": "ABCHkzuJQ8ZMd4Te84GK" }, "locationId": { "type": "string", "description": "Location Id", "example": "ABCHkzuJQ8ZMd4Te84GK" }, "lastMessageBody": { "type": "string", "description": "Content of the most recent message in the conversation", "example": "This is a sample message body" }, "lastMessageType": { "type": "string", "description": "Channel/type of the most recent message (SMS, Email, Call, etc)", "example": "TYPE_SMS", "enum": [ "TYPE_CALL", "TYPE_SMS", "TYPE_RCS", "TYPE_EMAIL", "TYPE_SMS_REVIEW_REQUEST", "TYPE_WEBCHAT", "TYPE_SMS_NO_SHOW_REQUEST", "TYPE_CAMPAIGN_SMS", "TYPE_CAMPAIGN_CALL", "TYPE_CAMPAIGN_EMAIL", "TYPE_CAMPAIGN_VOICEMAIL", "TYPE_FACEBOOK", "TYPE_CAMPAIGN_FACEBOOK", "TYPE_CAMPAIGN_MANUAL_CALL", "TYPE_CAMPAIGN_MANUAL_SMS", "TYPE_GMB", "TYPE_CAMPAIGN_GMB", "TYPE_REVIEW", "TYPE_INSTAGRAM", "TYPE_WHATSAPP", "TYPE_CUSTOM_SMS", "TYPE_CUSTOM_EMAIL", "TYPE_CUSTOM_PROVIDER_SMS", "TYPE_CUSTOM_PROVIDER_EMAIL", "TYPE_IVR_CALL", "TYPE_ACTIVITY_CONTACT", "TYPE_ACTIVITY_INVOICE", "TYPE_ACTIVITY_PAYMENT", "TYPE_ACTIVITY_OPPORTUNITY", "TYPE_LIVE_CHAT", "TYPE_LIVE_CHAT_INFO_MESSAGE", "TYPE_ACTIVITY_APPOINTMENT", "TYPE_FACEBOOK_COMMENT", "TYPE_INSTAGRAM_COMMENT", "TYPE_CUSTOM_CALL", "TYPE_INTERNAL_COMMENT", "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG", "TYPE_TIKTOK", "TYPE_TIKTOK_COMMENT", "TYPE_ACTIVITY_WHATSAPP", "TYPE_FORM_SUBMISSION", "TYPE_SMS_REACTION" ] }, "type": { "type": "string", "description": "Primary channel/type of the conversation (Phone, Email, etc)", "example": "TYPE_PHONE", "enum": [ "TYPE_PHONE", "TYPE_EMAIL", "TYPE_FB_MESSENGER", "TYPE_REVIEW", "TYPE_GROUP_SMS" ] }, "unreadCount": { "type": "number", "description": "Number of unread messages in this conversation", "example": 1 }, "fullName": { "type": "string", "description": "Complete name of the contact (first and last name)", "example": "John Doe" }, "contactName": { "type": "string", "description": "Alternative display name for the contact - used when full name is not available", "example": "John Doe Company" }, "email": { "type": "string", "description": "Primary email address of the contact", "example": "johndoe@mailingdomain.com" }, "phone": { "type": "string", "description": "Primary phone number of the contact", "example": "+15550001234" } }, "required": [ "id", "contactId", "locationId", "lastMessageBody", "lastMessageType", "type", "unreadCount", "fullName", "contactName", "email", "phone" ] }, "SendConversationResponseDto": { "type": "object", "properties": { "conversations": { "description": "The list of all conversations found for the given query", "type": "array", "items": { "$ref": "#/components/schemas/ConversationSchema" } }, "total": { "type": "number", "description": "Total Number of results found for the given query", "example": 100 } }, "required": [ "conversations", "total" ] }, "CreateConversationDto": { "type": "object", "properties": { "locationId": { "type": "string", "description": "Location ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "contactId": { "type": "string", "description": "Contact ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" } }, "required": [ "locationId", "contactId" ] }, "ConversationCreateResponseDto": { "type": "object", "properties": { "id": { "type": "string", "description": "Unique identifier for the conversation", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "dateUpdated": { "type": "string", "description": "Date when the conversation was last updated", "example": "2023-10-01T12:00:00Z" }, "dateAdded": { "type": "string", "description": "Date when the conversation was created", "example": "2023-10-01T12:00:00Z" }, "deleted": { "type": "boolean", "description": "Flag indicating if this conversation has been deleted", "example": false }, "contactId": { "type": "string", "description": "Unique identifier of the contact associated with this conversation", "example": "ve9EPM428kjkvShlRW1KT" }, "locationId": { "type": "string", "description": "Unique identifier of the business location where this conversation takes place", "example": "ve9EPM428kjkvShlRW1KT" }, "lastMessageDate": { "type": "string", "description": "Date of the last message in the conversation", "example": "2023-10-01T12:00:00Z" }, "assignedTo": { "type": "string", "description": "Unique identifier of the team member assigned to this conversation", "example": "ve9EPM428kjkvShlRW1KT" } }, "required": [ "id", "dateUpdated", "dateAdded", "deleted", "contactId", "locationId", "lastMessageDate" ] }, "CreateConversationSuccessResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Indicates whether the API request was successful.", "example": true }, "conversation": { "description": "Conversation data of the provided conversation ID.", "allOf": [ { "$ref": "#/components/schemas/ConversationCreateResponseDto" } ] } }, "required": [ "success", "conversation" ] }, "GetConversationByIdResponse": { "type": "object", "properties": { "contactId": { "type": "string", "description": "Unique identifier of the contact associated with this conversation", "example": "ve9EPM428kjkvShlRW1KT" }, "locationId": { "type": "string", "description": "Unique identifier of the business location where this conversation takes place", "example": "ve9EPM428kjkvShlRW1KT" }, "deleted": { "type": "boolean", "description": "Flag indicating if this conversation has been moved to trash/deleted", "example": false }, "inbox": { "type": "boolean", "description": "Flag indicating if this conversation is currently in the main inbox view", "example": true }, "type": { "type": "number", "description": "Communication channel type for this conversation: 1 (Phone), 2 (Email), 3 (Facebook Messenger), 4 (Review), 5 (Group SMS), 6 (Internal Chat - coming soon)" }, "unreadCount": { "type": "number", "description": "Number of messages in this conversation that have not been read by the user", "example": 1 }, "assignedTo": { "type": "string", "description": "Unique identifier of the team member currently responsible for handling this conversation", "example": "ve9EPM428kjkvShlRW1KT" }, "id": { "type": "string", "description": "Unique identifier for this specific conversation thread", "example": "ve9EPM428kjkvShlRW1KT" }, "starred": { "type": "boolean", "description": "Flag indicating if this conversation has been marked as important/starred by the user", "example": true } }, "required": [ "contactId", "locationId", "deleted", "inbox", "type", "unreadCount", "id" ] }, "UpdateConversationDto": { "type": "object", "properties": { "locationId": { "type": "string", "description": "Location ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "unreadCount": { "type": "number", "description": "Count of unread messages in the conversation", "example": 1 }, "starred": { "type": "boolean", "description": "Starred status of the conversation.", "example": true }, "feedback": { "type": "object" } }, "required": [ "locationId" ] }, "ConversationDto": { "type": "object", "properties": { "id": { "type": "string", "description": "Contact ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "locationId": { "type": "string", "description": "Location ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "contactId": { "type": "string", "description": "Contact ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "assignedTo": { "type": "string", "description": "Assigned User ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "userId": { "type": "string", "description": "User ID as string", "example": "tDtDnQdgm2LXpyiqYvZ6" }, "lastMessageBody": { "type": "string", "description": "Last message body as string", "example": "Hello, this is the message body" }, "lastMessageDate": { "type": "string", "description": "Last message date as UTC", "example": "1628008053263" }, "lastMessageType": { "type": "string", "description": "Type of the last message sent/received in the conversation.", "enum": [ "TYPE_CALL", "TYPE_SMS", "TYPE_RCS", "TYPE_EMAIL", "TYPE_SMS_REVIEW_REQUEST", "TYPE_WEBCHAT", "TYPE_SMS_NO_SHOW_REQUEST", "TYPE_CAMPAIGN_SMS", "TYPE_CAMPAIGN_CALL", "TYPE_CAMPAIGN_EMAIL", "TYPE_CAMPAIGN_VOICEMAIL", "TYPE_FACEBOOK", "TYPE_CAMPAIGN_FACEBOOK", "TYPE_CAMPAIGN_MANUAL_CALL", "TYPE_CAMPAIGN_MANUAL_SMS", "TYPE_GMB", "TYPE_CAMPAIGN_GMB", "TYPE_REVIEW", "TYPE_INSTAGRAM", "TYPE_WHATSAPP", "TYPE_CUSTOM_SMS", "TYPE_CUSTOM_EMAIL", "TYPE_CUSTOM_PROVIDER_SMS", "TYPE_CUSTOM_PROVIDER_EMAIL", "TYPE_IVR_CALL", "TYPE_ACTIVITY_CONTACT", "TYPE_ACTIVITY_INVOICE", "TYPE_ACTIVITY_PAYMENT", "TYPE_ACTIVITY_OPPORTUNITY", "TYPE_LIVE_CHAT", "TYPE_LIVE_CHAT_INFO_MESSAGE", "TYPE_ACTIVITY_APPOINTMENT", "TYPE_FACEBOOK_COMMENT", "TYPE_INSTAGRAM_COMMENT", "TYPE_CUSTOM_CALL", "TYPE_INTERNAL_COMMENT", "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG", "TYPE_TIKTOK", "TYPE_TIKTOK_COMMENT", "TYPE_ACTIVITY_WHATSAPP", "TYPE_FORM_SUBMISSION", "TYPE_SMS_REACTION" ], "example": "TYPE_CALL" }, "unreadCount": { "type": "number", "description": "Count of unread messages in the conversation", "example": 1 }, "inbox": { "type": "boolean", "description": "Inbox status of the conversation.", "example": true }, "starred": { "type": "boolean", "description": "Starred status of the conversation.", "example": true }, "deleted": { "type": "boolean", "description": "Deleted status of the conversation.", "example": false } }, "required": [ "locationId", "contactId", "deleted" ] }, "GetConversationSuccessfulResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Boolean value as the API response.", "example": true }, "conversation": { "description": "Conversation data of the provided conversation ID.", "allOf": [ { "$ref": "#/components/schemas/ConversationDto" } ] } }, "required": [ "success", "conversation" ] }, "DeleteConversationSuccessfulResponse": { "type": "object", "properties": { "success": { "type": "boolean", "description": "Boolean value as the API response.", "example": true } }, "required": [ "success" ] }, "CreateCustomSubtypeDto": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the custom subtype (max 100 characters)", "example": "Newsletter Subscription", "maxLength": 100 }, "description": { "type": "string", "description": "Description of the custom subtype (max 100 characters)", "example": "Weekly newsletter subscription preferences", "maxLength": 100 }, "channel": { "type": "string", "description": "Communication channel", "enum": [ "email", "sms" ], "example": "email" }, "language": { "type": "string", "description": "Language code", "example": "en" } }, "required": [ "name", "channel", "language" ] }, "UpdateCustomSubtypeDto": { "type": "object", "properties": { "name": { "type": "string", "description": "Name of the custom subtype (max 100 characters)", "example": "Newsletter Subscription", "maxLength": 100 }, "description": { "type": "string", "description": "Description of the custom subtype (max 100 characters)", "example": "Updated weekly newsletter subscription preferences", "maxLength": 100 }, "archived": { "type": "boolean", "description": "Whether the custom subtype is archived", "example": false }, "resubscription_legal_form_id": { "type": "string", "description": "Resubscription legal form ID (optional when archiving)", "example": "form_123456" } } }, "SubscriptionActionDto": { "type": "object", "properties": { "type": { "type": "string", "description": "Type of subscription action", "enum": [ "default", "custom", "resub_all" ], "example": "custom" }, "subtype_name": { "type": "string", "description": "Subscription type name (required for default types: \"One on One\")", "enum": [ "One on One" ], "example": "One on One" }, "subtype_id": { "type": "string", "description": "Custom subscription type ID (required for custom types)", "example": "ve9EPM428h8vShlRW1KT" }, "subtype_status": { "type": "string", "description": "Subscription status", "enum": [ "subscribed", "unsubscribed" ], "example": "unsubscribed" } }, "required": [ "type", "subtype_status" ] }, "UserSubscriptionChangeDto": { "type": "object", "properties": { "locationId": { "type": "string", "description": "Location Id", "example": "ve9EPM428h8vShlRW1KT" }, "contactId": { "type": "string", "description": "Contact Id", "example": "OP7z4LCyPACyH5fcEIZa" }, "email": { "type": "string", "description": "Email address", "example": "user@example.com" }, "subscription_action": { "description": "Subscription action details", "examples": { "default_one_on_one": { "summary": "Unsubscribe from One on One emails", "value": { "type": "default", "subtype_name": "One on One", "subtype_status": "unsubscribed" } }, "custom_newsletter": { "summary": "Subscribe to custom newsletter", "value": { "type": "custom", "subtype_id": "ve9EPM428h8vShlRW1KT", "subtype_status": "subscribed" } }, "resub_all": { "summary": "Resubscribe to all email types", "value": { "type": "resub_all", "subtype_status": "subscribed" } } }, "allOf": [ { "$ref": "#/components/schemas/SubscriptionActionDto" } ] }, "legal_reason": { "type": "string", "description": "Legal reason for the change (required only for resubscribe and resub_all actions)", "example": "User requested resubscribe via customer service" }, "legal_description": { "type": "string", "description": "Legal description/details", "example": "Customer called support on 2024-01-15 requesting to be removed from newsletter" } }, "required": [ "locationId", "contactId", "email", "subscription_action" ] }, "GetEmailMessageResponseDto": { "type": "object", "properties": { "id": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "altId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT", "description": "External Id" }, "threadId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT", "description": "Message Id or thread Id" }, "locationId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "contactId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "conversationId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "dateAdded": { "type": "string", "example": "2024-03-27T18:13:49.000Z" }, "subject": { "type": "string", "example": "Order confirm" }, "body": { "type": "string", "example": "Hi there" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "status": { "type": "string", "enum": [ "pending", "scheduled", "sent", "delivered", "read", "undelivered", "connected", "failed", "opened" ] }, "contentType": { "type": "string", "example": "text/plain" }, "attachments": { "description": "An array of attachment URLs.", "type": "array", "items": { "type": "string" } }, "provider": { "type": "string", "examples": [ "Leadconnector Gmail", "mailgun", "smtp", "custom" ] }, "from": { "type": "string", "description": "Name and Email Id of the sender" }, "to": { "description": "List of email Ids of the receivers", "type": "array", "items": { "type": "string" } }, "cc": { "description": "List of email Ids of the people in the cc field", "type": "array", "items": { "type": "string" } }, "bcc": { "description": "List of email Ids of the people in the bcc field", "type": "array", "items": { "type": "string" } }, "replyToMessageId": { "type": "string", "description": "In case of reply, email message Id of the reply to email" }, "source": { "type": "string", "enum": [ "workflow", "bulk_actions", "campaign", "api", "app" ], "description": "Email source" }, "conversationProviderId": { "type": "string", "example": "cI08i1Bls3iTB9bKgF01", "description": "Conversation provider ID" } }, "required": [ "id", "threadId", "locationId", "contactId", "conversationId", "dateAdded", "body", "direction", "contentType", "from", "to" ] }, "CancelScheduledResponseDto": { "type": "object", "properties": { "status": { "type": "number", "description": "HTTP Status code of the request", "example": 404 }, "message": { "type": "string", "description": "Error message of the request", "example": "Failed cancel the scheduled message" } }, "required": [ "status", "message" ] }, "MessageMeta": { "type": "object", "properties": { "callDuration": { "type": "string", "description": "Call duration in seconds", "example": 120 }, "callStatus": { "type": "string", "description": "Call status - can be pending, completed, answered, busy, no-answer, failed, canceled, or voicemail", "example": "completed", "enum": [ "pending", "completed", "answered", "busy", "no-answer", "failed", "canceled", "voicemail" ] }, "email": { "type": "object", "description": "meta will contain email, for message type 3 (email). messageIds is list of all email message ids under the message thread", "example": { "email": { "messageIds": [ "ve9EPM428kjkvShlRW1KT", "ve9EPs1028kjkvShlRW1KT" ] } } } } }, "GetMessageResponseDto": { "type": "object", "properties": { "id": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "type": { "type": "number", "example": 1 }, "messageType": { "type": "string", "description": "Type of the message as a string", "example": "SMS", "enum": [ "TYPE_CALL", "TYPE_SMS", "TYPE_RCS", "TYPE_EMAIL", "TYPE_SMS_REVIEW_REQUEST", "TYPE_WEBCHAT", "TYPE_SMS_NO_SHOW_REQUEST", "TYPE_CAMPAIGN_SMS", "TYPE_CAMPAIGN_CALL", "TYPE_CAMPAIGN_EMAIL", "TYPE_CAMPAIGN_VOICEMAIL", "TYPE_FACEBOOK", "TYPE_CAMPAIGN_FACEBOOK", "TYPE_CAMPAIGN_MANUAL_CALL", "TYPE_CAMPAIGN_MANUAL_SMS", "TYPE_GMB", "TYPE_CAMPAIGN_GMB", "TYPE_REVIEW", "TYPE_INSTAGRAM", "TYPE_WHATSAPP", "TYPE_CUSTOM_SMS", "TYPE_CUSTOM_EMAIL", "TYPE_CUSTOM_PROVIDER_SMS", "TYPE_CUSTOM_PROVIDER_EMAIL", "TYPE_IVR_CALL", "TYPE_ACTIVITY_CONTACT", "TYPE_ACTIVITY_INVOICE", "TYPE_ACTIVITY_PAYMENT", "TYPE_ACTIVITY_OPPORTUNITY", "TYPE_LIVE_CHAT", "TYPE_LIVE_CHAT_INFO_MESSAGE", "TYPE_ACTIVITY_APPOINTMENT", "TYPE_FACEBOOK_COMMENT", "TYPE_INSTAGRAM_COMMENT", "TYPE_CUSTOM_CALL", "TYPE_INTERNAL_COMMENT", "TYPE_ACTIVITY_EMPLOYEE_ACTION_LOG", "TYPE_TIKTOK", "TYPE_TIKTOK_COMMENT", "TYPE_ACTIVITY_WHATSAPP", "TYPE_FORM_SUBMISSION", "TYPE_SMS_REACTION" ] }, "locationId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "contactId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "conversationId": { "type": "string", "example": "ve9EPM428h8vShlRW1KT" }, "dateAdded": { "type": "string", "example": "2024-03-27T18:13:49.000Z" }, "body": { "type": "string", "example": "Hi there" }, "direction": { "type": "string", "enum": [ "inbound", "outbound" ] }, "status": { "type": "string", "enum": [ "connected", "delivered", "failed", "opened", "pending", "read", "scheduled", "sent", "undelivered", "clicked", "opt_out", "queued" ] }, "contentType": { "type": "string", "example": "text/plain" }, "attachments": { "description": "An array of attachment URLs. Attachments will be empty for Call and Voicemails, type 1 and 10. Please use get call recording API to fetch call recording and voicemails.", "type": "array", "items": { "type": "string" } }, "meta": { "$ref": "#/components/schemas/MessageMeta" }, "source": { "type": "string", "enum": [ "workflow", "bulk_actions", "campaign", "api", "app" ], "description": "Message source" }, "userId": { "type": "string", "description": "User Id", "example": "ve9EPM428kjkvShlRW1KT" }, "conversationProviderId": { "type": "string", "description": "Conversation Provider Id", "example": "ve9EPM428kjkvShlRW1KT" }, "chatWidgetId": { "type": "string", "description": "Chat Widget Id", "example": "67b0cc8cf14b19d85ace7s35" } }, "required": [ "id", "type", "messageType", "locationId", "contactId", "conversationId", "dateAdded", "direction", "contentType" ] }, "ExportMessagesResponseDto": { "type": "object", "properties": { "messages": { "description": "Array of messages", "type": "array", "items": { "$ref": "#/components/schemas/GetMessageResponseDto" } }, "nextCursor": { "type": "string", "description": "Cursor for fetching next page. Null if no more results.", "example": "eyJwaXRJZCI6ImFiYy0xMjMiLCJsYXN0U29ydCI6WzE2NDY4NjQ0MDBdLCJsYXN0SWQiOiIxMjMifQ==" }, "total": { "type": "number", "description": "Total number of messages matching the query", "example": 1234 } }, "required": [ "messages", "total" ] }, "GetMessagesByConversationResponseDto": { "type": "object", "properties": { "lastMessageId": { "type": "string", "description": "Id of the last message in the messages array", "example": "p1mRSHeLDhAms5q0LMr4" }, "nextPage": { "type": "boolean", "description": "Next page value true indicates only 20 message is in the response. Rest of the messages are in the next page. Please use the lastMessageId value in the query to get the next page messages", "example": true }, "messages": { "description": "Array of messages", "type": "array", "items": { "$ref": "#/components/schemas/GetMessageResponseDto" } } }, "required": [ "lastMessageId", "nextPage", "messages" ] }, "ForwardConfigDto": { "type": "object", "properties": { "isForwarded": { "type": "boolean", "description": "Specify if this is a forwarded email", "example": true }, "forwardWholeThread": { "type": "boolean", "description": "Specify if forwarding the whole thread or just a single email", "example": false }, "messageId": { "type": "string", "description": "Message ID of the email thread being forwarded (source) - REQUIRED for forwarding", "example": "t22c6DQcTDf3MjRhwf77" }, "emailMessageId": { "type": "string", "description": "Email Message ID of the specific email being forwarded (source) - Required for single email forward, ignored for thread forward", "example": "rnGyqh2F6uBrIkfhFo9A" }, "sourceContactId": { "type": "string", "description": "Contact ID where the forwarded email originated from (source) - Auto-populated if not provided", "example": "ABC12h2F6uBrIkfXYazb" }, "sourceConversationId": { "type": "string", "description": "Conversation ID where the forwarded email originated from (source) - Auto-populated if not provided", "example": "XYZ12h2F6uBrIkfXYacd" }, "toEmail": { "type": "string", "description": "Email address to forward to (destination)", "example": "forward@example.com" }, "recipientContactId": { "type": "string", "description": "Contact ID of recipient when forwarding (destination)", "example": "DEF56h2F6uBrIkfXYacd" }, "recipientConversationId": { "type": "string", "description": "Conversation ID of recipient when forwarding (destination)", "example": "GHI78h2F6uBrIkfXYefg" } }, "required": [ "isForwarded" ] }, "SendMessageBodyDto": { "type": "object", "properties": { "type": { "type": "string", "enum": [ "SMS", "RCS", "Email", "WhatsApp", "IG", "FB", "Custom", "Live_Chat", "TIKTOK" ], "description": "Type of message being sent", "example": "Email" }, "subType": { "type": "object", "description": "Type of message being sent", "example": "Email" }, "contactId": { "type": "string", "description": "ID of the contact receiving the message", "example": "abc123def456" }, "appointmentId": { "type": "string", "description": "ID of the associated appointment", "example": "appt123" }, "attachments": { "description": "Array of attachment URLs", "example": [ "https://storage.com/file1.pdf", "https://storage.com/file2.jpg" ], "type": "array", "items": { "type": "string" } }, "emailFrom": { "type": "string", "description": "Email address to send from", "example": "sender@company.com" }, "emailCc": { "description": "Array of CC email addresses", "example": [ "cc1@company.com", "cc2@company.com" ], "type": "array", "items": { "type": "string" } }, "emailBcc": { "description": "Array of BCC email addresses", "example": [ "bcc1@company.com", "bcc2@company.com" ], "type": "array", "items": { "type": "string" } }, "html": { "type": "string", "description": "HTML content of the message", "example": "

Hello World

" }, "message": { "type": "string", "description": "Text content of the message", "example": "Hello, how can I help you today?" }, "subject": { "type": "string", "description": "Subject line for email messages", "example": "Important Update" }, "replyMessageId": { "type": "string", "description": "ID of message being replied to", "example": "msg123" }, "templateId": { "type": "string", "description": "ID of message template", "example": "template123" }, "threadId": { "type": "string", "description": "ID of message thread. For email messages, this is the message ID that contains multiple email messages in the thread", "example": "thread123" }, "scheduledTimestamp": { "type": "number", "description": "UTC Timestamp (in seconds) at which the message should be scheduled", "example": 1669287863 }, "conversationProviderId": { "type": "string", "description": "ID of conversation provider", "example": "provider123" }, "emailTo": { "type": "string", "description": "Email address to send to, if different from contact's primary email. This should be a valid email address associated with the contact.", "example": "recipient@company.com" }, "customSubtypeId": { "type": "string", "description": "Custom subtype ID for email unsubscription preferences. Only applies to email messages.", "example": "507f1f77bcf86cd799439011" }, "emailReplyMode": { "type": "string", "enum": [ "reply", "reply_all" ], "description": "Mode for email replies", "example": "reply_all" }, "fromNumber": { "type": "string", "description": "Phone number used as the sender number for outbound messages", "example": "+1499499299" }, "toNumber": { "type": "string", "description": "Recipient phone number for outbound messages", "example": "+1439499299" }, "forward": { "description": "Forwarding configuration for emails", "example": { "isForwarded": true, "forwardWholeThread": false, "messageId": "t22c6DQcTDf3MjRhwf77", "emailMessageId": "rnGyqh2F6uBrIkfhFo9A", "toEmail": "forward@example.com", "recipientContactId": "DEF56h2F6uBrIkfXYacd" }, "allOf": [ { "$ref": "#/components/schemas/ForwardConfigDto" } ] }, "status": { "type": "string", "description": "Message status", "example": "delivered", "enum": [ "delivered", "failed", "pending", "read" ] }, "usesNativeSchedulingAi": { "type": "boolean", "description": "Whether the scheduled email uses native AI for the email scheduling ", "example": false }, "optimizationPeriod": { "type": "string", "description": "Optimization period in hours (24h, 48h, or 72h)", "example": "24h", "enum": [ "24h", "48h", "72h" ] } }, "required": [ "type", "subType", "contactId", "status" ] }, "ForwardResponseDto": { "type": "object", "properties": { "forwardWholeThread": { "type": "boolean", "description": "Whether the entire thread was forwarded", "example": false }, "messageId": { "type": "string", "description": "Message ID of the forwarded message (source)", "example": "t22c6DQcTDf3MjRhwf77" }, "emailMessageId": { "type": "string", "description": "Email Message ID of the forwarded email (source)", "example": "rnGyqh2F6uBrIkfhFo9A" }, "sourceContactId": { "type": "string", "description": "Contact ID where the forwarded email originated from (source)", "example": "ABC12h2F6uBrIkfXYazb" }, "sourceConversationId": { "type": "string", "description": "Conversation ID where the forwarded email originated from (source)", "example": "XYZ12h2F6uBrIkfXYacd" }, "forwardToEmail": { "type": "string", "description": "Email address the message was forwarded to (destination)", "example": "recipient@example.com" }, "recipientContactId": { "type": "string", "description": "Contact ID of the recipient of the forwarded email (destination)", "example": "DEF56h2F6uBrIkfXYacd" }, "recipientConversationId": { "type": "string", "description": "Conversation ID of the recipient of the forwarded email (destination)", "example": "GHI78h2F6uBrIkfXYefg" } } }, "SendMessageResponseDto": { "type": "object", "properties": { "conversationId": { "type": "string", "description": "Conversation ID.", "example": "ABC12h2F6uBrIkfXYazb" }, "emailMessageId": { "type": "string", "description": "This contains the email message id (only for Email type). Use this ID to send inbound replies to GHL to create a threaded email.", "example": "rnGyqh2F6uBrIkfhFo9A" }, "messageId": { "type": "string", "description": "This is the main Message ID", "example": "t22c6DQcTDf3MjRhwf77" }, "messageIds": { "description": "When sending via the GMB channel, we will be returning list of `messageIds` instead of single `messageId`.", "type": "array", "items": { "type": "string" } }, "msg": { "type": "string", "description": "Additional response message when sending a workflow message", "example": "Message queued successfully." }, "forwardData": { "description": "Optional metadata for forwarded email", "example": { "forwardWholeThread": false, "messageId": "t22c6DQcTDf3MjRhwf77", "emailMessageId": "rnGyqh2F6uBrIkfhFo9A", "forwardToEmail": "recipient@example.com", "recipientContactId": "DEF56h2F6uBrIkfXYacd" }, "allOf": [ { "$ref": "#/components/schemas/ForwardResponseDto" } ] }, "status": { "type": "string", "description": "Message status", "example": "delivered", "enum": [ "delivered", "failed", "pending", "read" ] } }, "required": [ "conversationId", "messageId", "status" ] }, "CallDataDTO": { "type": "object", "properties": { "to": { "type": "string", "description": "Phone number of the receiver", "example": "+15037081210" }, "from": { "type": "string", "description": "Phone number of the dialer", "example": "+15037081210" }, "status": { "type": "string", "description": "Call status", "example": "completed", "enum": [ "pending", "completed", "answered", "busy", "no-answer", "failed", "canceled", "voicemail" ] } } }, "ProcessMessageBodyDto": { "type": "object", "properties": { "type": { "type": "string", "description": "Message Type", "example": "SMS", "enum": [ "SMS", "RCS", "Email", "WhatsApp", "GMB", "IG", "FB", "Custom", "WebChat", "Live_Chat", "Call", "IVR_Call", "Campaign_Call", "Campaign_VoiceMail", "TIKTOK", "ALL_IN_ONE_CHAT", "FORM_SUBMISSION" ] }, "attachments": { "description": "Array of attachments", "type": "array", "items": { "type": "string" } }, "message": { "type": "string", "description": "Message Body" }, "conversationId": { "type": "string", "description": "Conversation Id", "example": "ve9EPM428h8vShlRW1KT" }, "contactId": { "type": "string", "description": "Contact Id", "example": "ve9EPM428h8vShlRW1KT" }, "conversationProviderId": { "type": "string", "description": "Conversation Provider Id", "example": "61d6d1f9cdac7612faf80753" }, "html": { "type": "string", "description": "HTML Body of Email" }, "subject": { "type": "string", "description": "Subject of the Email" }, "emailFrom": { "type": "string", "description": "Email address to send from. This field is associated with the contact record and cannot be dynamically changed.", "example": "sender@company.com" }, "emailTo": { "type": "string", "description": "Recipient email address. This field is associated with the contact record and cannot be dynamically changed." }, "emailCc": { "description": "List of email address to CC", "example": [ "john1@doe.com", "john2@doe.com" ], "type": "array", "items": { "type": "string" } }, "emailBcc": { "description": "List of email address to BCC", "example": [ "john1@doe.com", "john2@doe.com" ], "type": "array", "items": { "type": "string" } }, "emailMessageId": { "type": "string", "description": "Send the email message id for which this email should be threaded. This is for replying to a specific email" }, "altId": { "type": "string", "description": "external mail provider's message id", "example": "61d6d1f9cdac7612faf80753" }, "direction": { "type": "object", "description": "Message direction, if required can be set manually, default is outbound", "default": "outbound", "example": [ "outbound", "inbound" ] }, "date": { "format": "date-time", "type": "string", "description": "Date of the inbound message" }, "call": { "description": "Phone call dialer and receiver information", "allOf": [ { "$ref": "#/components/schemas/CallDataDTO" } ] } }, "required": [ "type", "conversationId", "contactId", "conversationProviderId" ] }, "ProcessMessageResponseDto": { "type": "object", "properties": { "success": { "type": "boolean" }, "conversationId": { "type": "string", "description": "Conversation ID.", "example": "ABC12h2F6uBrIkfXYazb" }, "messageId": { "type": "string", "description": "This is the main Message ID", "example": "t22c6DQcTDf3MjRhwf77" }, "message": { "type": "string" }, "contactId": { "type": "string" }, "dateAdded": { "format": "date-time", "type": "string" }, "emailMessageId": { "type": "string" } }, "required": [ "success", "conversationId", "messageId", "message" ] }, "ProcessOutboundMessageBodyDto": { "type": "object", "properties": { "type": { "type": "string", "description": "Message Type", "example": "Call", "enum": [ "Call" ] }, "attachments": { "description": "Array of attachments", "type": "array", "items": { "type": "string" } }, "conversationId": { "type": "string", "description": "Conversation Id", "example": "ve9EPM428h8vShlRW1KT" }, "conversationProviderId": { "type": "string", "description": "Conversation Provider Id", "example": "61d6d1f9cdac7612faf80753" }, "altId": { "type": "string", "description": "external mail provider's message id", "example": "61d6d1f9cdac7612faf80753" }, "date": { "format": "date-time", "type": "string", "description": "Date of the outbound message" }, "call": { "description": "Phone call dialer and receiver information", "allOf": [ { "$ref": "#/components/schemas/CallDataDTO" } ] } }, "required": [ "type", "conversationId", "conversationProviderId" ] }, "SendReviewReplyDto": { "type": "object", "properties": { "conversationId": { "type": "string", "description": "Conversation ID (must have reviewId)", "example": "conv123" }, "locationId": { "type": "string", "description": "Location ID", "example": "loc123" }, "message": { "type": "string", "description": "Review reply message text", "example": "Thank you for your review!" } }, "required": [ "conversationId", "locationId", "message" ] }, "UploadFilesDto": { "type": "object", "properties": { "conversationId": { "type": "string", "description": "Conversation Id", "example": "ve9EPM428h8vShlRW1KT" }, "contactId": { "type": "string", "description": "Contact Id", "example": "ve9EPM428h8vShlRW1KT" }, "locationId": { "type": "string" }, "attachmentUrls": { "type": "array", "items": { "type": "string" } }, "chatServiceSid": { "type": "string", "description": "Twilio chat service SID for group SMS uploads", "example": "ISxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }, "isGroupSms": { "type": "string", "description": "Flag to indicate group SMS upload flow. When true, only 1 file upload is allowed per request.", "example": "true" } }, "required": [ "conversationId", "contactId", "locationId", "attachmentUrls" ] }, "UploadFilesResponseDto": { "type": "object", "properties": { "uploadedFiles": { "type": "object" }, "twilioMediaSids": { "description": "Twilio media SIDs for group SMS (when isGroupSms=true)", "example": [ "MExxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ], "type": "array", "items": { "type": "string" } } }, "required": [ "uploadedFiles" ] }, "UploadFilesErrorResponseDto": { "type": "object", "properties": { "status": { "type": "number", "description": "HTTP Status code of the request", "example": 413, "enum": [ 400, 413, 415 ] }, "message": { "type": "string", "description": "Error message of the request", "example": "Failed to upload the files" } }, "required": [ "status", "message" ] }, "InitiateFileUploadDto": { "type": "object", "properties": { "locationId": { "type": "string", "description": "Location ID", "example": "ve9EPM428h8vShlRW1KT" }, "conversationId": { "type": "string", "description": "Conversation ID", "example": "ve9EPM428h8vShlRW1KT" }, "filename": { "type": "string", "description": "Original filename with extension", "example": "video.mp4" }, "contentType": { "type": "string", "description": "MIME type of the file", "example": "video/mp4" }, "fileSize": { "type": "number", "description": "File size in bytes (optional, for pre-validation)", "example": 52428800 }, "channel": { "type": "string", "description": "Channel type for size limits (WHATSAPP for 100MB limit, others for 5MB)", "example": "WHATSAPP" } }, "required": [ "locationId", "conversationId", "filename", "contentType", "channel" ] }, "InitiateFileUploadResponseDto": { "type": "object", "properties": { "uploadUrl": { "type": "string", "description": "Signed URL for direct upload to GCS. Use PUT request with file content.", "example": "https://storage.googleapis.com/bucket/path?X-Goog-Algorithm=..." }, "uploadId": { "type": "string", "description": "Unique upload ID for tracking and completing the upload", "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "filePath": { "type": "string", "description": "File path in GCS bucket (needed for confirmation endpoint)", "example": "location/loc123/conversations/conv456/uuid.mp4" }, "expiresAt": { "type": "number", "description": "URL expiration timestamp (Unix milliseconds)", "example": 1701619200000 }, "maxFileSize": { "type": "number", "description": "Maximum allowed file size in bytes", "example": 104857600 } }, "required": [ "uploadUrl", "uploadId", "filePath", "expiresAt", "maxFileSize" ] }, "CompleteFileUploadDto": { "type": "object", "properties": { "uploadId": { "type": "string", "description": "Upload ID from request response", "example": "a1b2c3d4-e5f6-7890-abcd-ef1234567890" }, "filePath": { "type": "string", "description": "File path from request response", "example": "location/loc123/conversations/conv456/uuid.mp4" }, "locationId": { "type": "string", "description": "Location ID", "example": "ve9EPM428h8vShlRW1KT" }, "conversationId": { "type": "string", "description": "Conversation ID", "example": "ve9EPM428h8vShlRW1KT" }, "filename": { "type": "string", "description": "Original filename (for response mapping)", "example": "video.mp4" } }, "required": [ "uploadId", "filePath", "locationId", "conversationId", "filename" ] }, "CompleteFileUploadResponseDto": { "type": "object", "properties": { "uploadedFiles": { "type": "object", "description": "Map of filename to public URL", "example": { "video.mp4": "https://your-domain.com/conversations-assets/location/.../video.mp4" } }, "metadata": { "type": "object", "description": "File metadata", "example": { "size": 52428800, "contentType": "video/mp4" } } }, "required": [ "uploadedFiles", "metadata" ] }, "ErrorDto": { "type": "object", "properties": { "code": { "type": "string", "description": "Error Code", "example": "1" }, "type": { "type": "string", "description": "Error Type", "example": "saas" }, "message": { "type": "string", "description": "Error Message", "example": "There was an error from the provider" } }, "required": [ "code", "type", "message" ] }, "UpdateMessageStatusDto": { "type": "object", "properties": { "status": { "type": "string", "description": "Message status", "example": "read", "enum": [ "delivered", "failed", "pending", "read" ] }, "error": { "description": "Error object from the conversation provider", "allOf": [ { "$ref": "#/components/schemas/ErrorDto" } ] }, "emailMessageId": { "type": "string", "description": "Email message Id", "example": "ve9EPM428h8vShlRW1KT" }, "recipients": { "description": "Email delivery status for additional email recipients.", "type": "array", "items": { "type": "string" } } }, "required": [ "status" ] }, "AddMessageAttachmentsDto": { "type": "object", "properties": { "attachments": { "description": "Array of attachment URLs to set on the message (replaces existing). Maximum 5 URLs.", "example": [ "https://provider.com/recordings/call-123.mp3" ], "type": "array", "items": { "type": "string" } } }, "required": [ "attachments" ] }, "GetMessageTranscriptionResponseDto": { "type": "object", "properties": { "mediaChannel": { "type": "number", "description": "Media channel describes the user interaction channel", "example": "1" }, "sentenceIndex": { "type": "number", "description": "Index of the sentence in the transcription", "example": "1" }, "startTime": { "type": "number", "description": "Start time of the sentence in milliseconds", "example": "34" }, "endTime": { "type": "number", "description": "End time of the sentence in milliseconds", "example": "45" }, "transcript": { "type": "string", "description": "Transcript of the sentence", "example": "This call may be recorded for quality assurance purposes." }, "confidence": { "type": "number", "description": "Confidence of the transcription", "example": "0.5" } }, "required": [ "mediaChannel", "sentenceIndex", "startTime", "endTime", "transcript", "confidence" ] }, "UserTypingBody": { "type": "object", "properties": { "locationId": { "type": "string", "description": "Location Id", "example": "ve9EPM428h8vShlRW1KT" }, "isTyping": { "type": "string", "description": "Typing status", "example": true }, "visitorId": { "type": "string", "description": "visitorId is the Unique ID assigned to each Live chat visitor. visitorId will be added soon in GET Contact API", "example": "ve9EPM428h8vShlRW1KT" }, "conversationId": { "type": "string", "description": "Conversation Id", "example": "ve9EPM428h8vShlRW1KT" } }, "required": [ "locationId", "isTyping", "visitorId", "conversationId" ] }, "CreateLiveChatMessageFeedbackResponse": { "type": "object", "properties": { "success": { "type": "boolean" } }, "required": [ "success" ] } } }, "x-tagGroups": { "name": "Conversations", "tags": [ "Conversations", "Search", "Preference Management", "Email", "Messages", "Providers" ] } }