curl --location --request POST 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent' \--header 'Authorization: Bearer 844b4b95-bd79-4583-b6df-83bfa10a8f42' \--header 'Content-Type: application/json' \--data-raw '{ "visitorId": "crmchatsappai_27_REMPLAZAR_ID", "query": "¡Hola [NOMBRE]! Hace un tiempo recibimos tu consulta por el proyecto Osten Tower. Te escribimos para adelantarte el lanzamiento de Osten Tower II. ¡No te pierdas la oportunidad de ser parte de este increíble emprendimiento en Puerto Madero!¿Te gustaría saber más?", "conversationId": "crmchatsappai_27_REMPLAZAR_ID", "streaming": false, "channel": "api"}'
const apiUrl = 'https://dashboard.laburen.com/api';const apiKey = '<API_KEY>';const agentId = 'clxxxxxxxxxxxxxxxxx';// Add agent message to conversationconst response = await fetch(`${apiUrl}/agents/${agentId}/query-agent`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}`, }, body: JSON.stringify({ query: 'Hello! How can I help you today?', visitorId: 'visitor-abc123', conversationId: 'clxxxxxxxxxxxxxxxxx', // Optional: to add to existing conversation channel: 'whatsapp', channelExternalId: 'org123_agent456_+1234567890', // Format: {organizationId}_{agentId}_{telephoneNumber} contact: { phoneNumber: '+1234567890', firstName: 'John', lastName: 'Doe', }, }),});const data = await response.json();console.log('Message ID:', data.messageId);console.log('Conversation ID:', data.conversationId);
import requestsapi_url = "https://dashboard.laburen.com/api"api_key = "<API_KEY>"agent_id = "clxxxxxxxxxxxxxxxxx"# Add agent message to conversationresponse = requests.post( f"{api_url}/agents/{agent_id}/query-agent", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", }, json={ "query": "Hello! How can I help you today?", "visitorId": "visitor-abc123", "conversationId": "clxxxxxxxxxxxxxxxxx", # Optional: to add to existing conversation "channel": "whatsapp", "channelExternalId": "org123_agent456_+1234567890", # Format: {organizationId}_{agentId}_{telephoneNumber} "contact": { "phoneNumber": "+1234567890", "firstName": "John", "lastName": "Doe", }, },)data = response.json()print("Message ID:", data["messageId"])print("Conversation ID:", data["conversationId"])
Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.
curl --location --request POST 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent' \--header 'Authorization: Bearer 844b4b95-bd79-4583-b6df-83bfa10a8f42' \--header 'Content-Type: application/json' \--data-raw '{ "visitorId": "crmchatsappai_27_REMPLAZAR_ID", "query": "¡Hola [NOMBRE]! Hace un tiempo recibimos tu consulta por el proyecto Osten Tower. Te escribimos para adelantarte el lanzamiento de Osten Tower II. ¡No te pierdas la oportunidad de ser parte de este increíble emprendimiento en Puerto Madero!¿Te gustaría saber más?", "conversationId": "crmchatsappai_27_REMPLAZAR_ID", "streaming": false, "channel": "api"}'
const apiUrl = 'https://dashboard.laburen.com/api';const apiKey = '<API_KEY>';const agentId = 'clxxxxxxxxxxxxxxxxx';// Add agent message to conversationconst response = await fetch(`${apiUrl}/agents/${agentId}/query-agent`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}`, }, body: JSON.stringify({ query: 'Hello! How can I help you today?', visitorId: 'visitor-abc123', conversationId: 'clxxxxxxxxxxxxxxxxx', // Optional: to add to existing conversation channel: 'whatsapp', channelExternalId: 'org123_agent456_+1234567890', // Format: {organizationId}_{agentId}_{telephoneNumber} contact: { phoneNumber: '+1234567890', firstName: 'John', lastName: 'Doe', }, }),});const data = await response.json();console.log('Message ID:', data.messageId);console.log('Conversation ID:', data.conversationId);
import requestsapi_url = "https://dashboard.laburen.com/api"api_key = "<API_KEY>"agent_id = "clxxxxxxxxxxxxxxxxx"# Add agent message to conversationresponse = requests.post( f"{api_url}/agents/{agent_id}/query-agent", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", }, json={ "query": "Hello! How can I help you today?", "visitorId": "visitor-abc123", "conversationId": "clxxxxxxxxxxxxxxxxx", # Optional: to add to existing conversation "channel": "whatsapp", "channelExternalId": "org123_agent456_+1234567890", # Format: {organizationId}_{agentId}_{telephoneNumber} "contact": { "phoneNumber": "+1234567890", "firstName": "John", "lastName": "Doe", }, },)data = response.json()print("Message ID:", data["messageId"])print("Conversation ID:", data["conversationId"])
Add agent messages to existing or new conversations
Support for external channel integrations (WhatsApp, Chatwoot, CRM)
Automatic contact creation and association
This endpoint is different from the Query endpoint, which sends user messages and receives AI responses. This endpoint is for adding agent messages to the conversation history.
Path
string
required
The ID of the agent (CUID format).
Body
Required
string
required
The agent message text to add to the conversation history.
Optional - Basic Configuration
boolean
default:"false"
If true, responds with Server-Sent Events in real-time.
string
ID of the conversation to add the message to. Auto-generated if not provided.
For Chatwoot/CRM integrations: The conversationId format is essential to ensure messages are placed in the correct conversation. Use the format crmchatsappai_{accountId}_{customerId} to match existing conversations. Without the correct format, messages may be added to the wrong conversation thread.
string
Unique ID of the visitor/user. Auto-generated if not provided.
Used to link messages from external platforms to conversations in Laburen.
For WhatsApp Embedding: The channelExternalId is essential to ensure messages are placed in the correct conversation. Without it, messages may be added to the wrong conversation thread.
boolean
default:"false"
If true, creates a draft message. Requires authentication.
string
ID of an existing contact to associate with the conversation.
Optional - Contact
object
Contact data to create or associate with the conversation. If a contact with matching email, phone number, or userId exists, it will be used. Otherwise, a new contact will be created.
Show Contact object
string
Contact’s email address.
string
Contact’s phone number.
string
External user ID from your system.
string
Contact’s first name.
string
Contact’s last name.
Optional - Metadata
object
Additional metadata for the message.
Show Metadata object
string
Context data for WhatsApp integrations.
string
Channel override (alternative to top-level channel field).
Response (without streaming)
string
ID of the created message.
string
ID of the conversation (save this to continue adding messages to the same conversation).
string
ID of the visitor/user.
string
Conversation status (e.g., UNRESOLVED, RESOLVED).
Error Responses
Status Code
Type
Description
401
UNAUTHORIZED
Missing or invalid authentication when isDraft is true, or when required for the operation.
curl --location --request POST 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent' \--header 'Authorization: Bearer 844b4b95-bd79-4583-b6df-83bfa10a8f42' \--header 'Content-Type: application/json' \--data-raw '{ "visitorId": "crmchatsappai_27_REMPLAZAR_ID", "query": "¡Hola [NOMBRE]! Hace un tiempo recibimos tu consulta por el proyecto Osten Tower. Te escribimos para adelantarte el lanzamiento de Osten Tower II. ¡No te pierdas la oportunidad de ser parte de este increíble emprendimiento en Puerto Madero!¿Te gustaría saber más?", "conversationId": "crmchatsappai_27_REMPLAZAR_ID", "streaming": false, "channel": "api"}'
const apiUrl = 'https://dashboard.laburen.com/api';const apiKey = '<API_KEY>';const agentId = 'clxxxxxxxxxxxxxxxxx';// Add agent message to conversationconst response = await fetch(`${apiUrl}/agents/${agentId}/query-agent`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': `Bearer ${apiKey}`, }, body: JSON.stringify({ query: 'Hello! How can I help you today?', visitorId: 'visitor-abc123', conversationId: 'clxxxxxxxxxxxxxxxxx', // Optional: to add to existing conversation channel: 'whatsapp', channelExternalId: 'org123_agent456_+1234567890', // Format: {organizationId}_{agentId}_{telephoneNumber} contact: { phoneNumber: '+1234567890', firstName: 'John', lastName: 'Doe', }, }),});const data = await response.json();console.log('Message ID:', data.messageId);console.log('Conversation ID:', data.conversationId);
import requestsapi_url = "https://dashboard.laburen.com/api"api_key = "<API_KEY>"agent_id = "clxxxxxxxxxxxxxxxxx"# Add agent message to conversationresponse = requests.post( f"{api_url}/agents/{agent_id}/query-agent", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {api_key}", }, json={ "query": "Hello! How can I help you today?", "visitorId": "visitor-abc123", "conversationId": "clxxxxxxxxxxxxxxxxx", # Optional: to add to existing conversation "channel": "whatsapp", "channelExternalId": "org123_agent456_+1234567890", # Format: {organizationId}_{agentId}_{telephoneNumber} "contact": { "phoneNumber": "+1234567890", "firstName": "John", "lastName": "Doe", }, },)data = response.json()print("Message ID:", data["messageId"])print("Conversation ID:", data["conversationId"])
{ "visitorId": "{{$json.contacts[0].wa_id}}", "query": "{{ $('Combino mensaje con cada fletero').last().json.mensaje}}", "streaming": false, "channel": "whatsapp", "channelExternalId": "{organizationId}_{agentId}_{{$json.contacts[0].wa_id}}"}
The channelExternalId format: {organizationId}_{agentId}_{telephoneNumber}
Critical: The channelExternalId is essential for WhatsApp Embedding integration. Without it, messages will not be placed in the correct conversation thread. Always include this field with the exact format {organizationId}_{agentId}_{telephoneNumber} when using WhatsApp channel.
Critical: The conversationId format is essential for Chatwoot/CRM integrations. Use the exact format crmchatsappai_{accountId}_{customerId} to match existing conversations. Without the correct format, messages will not be placed in the correct conversation thread.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Laburen Documentacion","colors":{"primary":"#2DFD8E","light":"#177F47","dark":"#2DFD8E"},"logo":{"light":"https://mintcdn.com/chatsappaicom/X5lst3Tqt1FgRzc5/logo/light.png?fit=max\u0026auto=format\u0026n=X5lst3Tqt1FgRzc5\u0026q=85\u0026s=36f7a5dd80146c505715bd5f7132b1bf","dark":"https://mintcdn.com/chatsappaicom/X5lst3Tqt1FgRzc5/logo/dark.png?fit=max\u0026auto=format\u0026n=X5lst3Tqt1FgRzc5\u0026q=85\u0026s=8d61eaddbeb3e5716a96d68ed804489f"},"favicon":"https://mintcdn.com/chatsappaicom/X5lst3Tqt1FgRzc5/favicon.png?fit=max\u0026auto=format\u0026n=X5lst3Tqt1FgRzc5\u0026q=85\u0026s=f49884435529f5e7248021e2eacee209","navbar":{"primary":{"type":"button","label":"Inicia ahora","href":"https://Laburen.com/"}},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"chatsappaicom","hasAudioNarration":false,"actualSubdomain":"chatsappaicom","customDomains":["docs.laburen.com"],"gitSource":{"type":"github","owner":"laburen","repo":"laburen-docs","deployBranch":"main","contentDirectory":"","isPrivate":false,"mountPath":"","label":""},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{},"buildId":"6aeb6658edeafab81dc5bfcd","clientVersion":"0.0.4271","searchFilterCounts":[{"language":"default","tag":"Agentes","count":32},{"language":"default","tag":"API","count":18},{"language":"default","tag":"Endpoints","count":17},{"language":"default","tag":"Integraciones","count":10},{"language":"default","tag":"Annotations","count":8},{"language":"default","tag":"Documentation","count":8},{"language":"default","tag":"Herramientas","count":6},{"language":"default","tag":"Privacidad","count":5},{"language":"default","tag":"🚀 Instalalo en","count":4},{"language":"default","tag":"Vision General","count":3}]},"assistantConfig":{},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"site-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"wildcard-email-auth","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"api-reference/endpoint/agents/query-agent","slug":"/api-reference/endpoint/agents/query-agent","pageMetadata":{"title":"Agent - Query Agent","api":"POST https://dashboard.laburen.com/api/agents/{id}/query-agent","description":"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.","href":"/api-reference/endpoint/agents/query-agent"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Key Features:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Add agent messages to existing or new conversations`}),`\n`,_jsx(_components.li,{children:`Support for external channel integrations (WhatsApp, Chatwoot, CRM)`}),`\n`,_jsx(_components.li,{children:`Automatic contact creation and association`}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This endpoint is different from the `,_jsx(_components.a,{href:`/api-reference/endpoint/agents/query`,children:`Query endpoint`}),`, which sends user messages and receives AI responses. This endpoint is for adding agent messages to the conversation history.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`path`,children:`Path`}),`\n`,_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The ID of the agent (CUID format).`})}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsx(Heading,{level:`4`,id:`required`,children:`Required`}),`\n`,_jsx(ParamField,{body:`query`,type:`string`,required:true,id:`param-query`,children:_jsx(_components.p,{children:`The agent message text to add to the conversation history.`})}),`\n`,_jsx(Heading,{level:`4`,id:`optional-basic-configuration`,children:`Optional - Basic Configuration`}),`\n`,_jsx(ParamField,{body:`streaming`,type:`boolean`,default:`false`,id:`param-streaming`,children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`true`}),`, responds with Server-Sent Events in real-time.`]})}),`\n`,_jsxs(ParamField,{body:`conversationId`,type:`string`,id:`param-conversation-id`,children:[_jsx(_components.p,{children:`ID of the conversation to add the message to. Auto-generated if not provided.`}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`For Chatwoot/CRM integrations`}),`: The `,_jsx(_components.code,{children:`conversationId`}),` format is `,_jsx(_components.strong,{children:`essential`}),` to ensure messages are placed in the correct conversation. Use the format `,_jsx(_components.code,{children:`crmchatsappai_{accountId}_{customerId}`}),` to match existing conversations. Without the correct format, messages may be added to the wrong conversation thread.`]})})]}),`\n`,_jsx(ParamField,{body:`visitorId`,type:`string`,id:`param-visitor-id`,children:_jsx(_components.p,{children:`Unique ID of the visitor/user. Auto-generated if not provided.`})}),`\n`,_jsx(ParamField,{body:`channel`,type:`string`,default:`api`,id:`param-channel`,children:_jsxs(_components.p,{children:[`Source channel for the message. Valid values: `,_jsx(_components.code,{children:`api`}),`, `,_jsx(_components.code,{children:`dashboard`}),`, `,_jsx(_components.code,{children:`website`}),`, `,_jsx(_components.code,{children:`form`}),`, `,_jsx(_components.code,{children:`whatsapp`}),`, `,_jsx(_components.code,{children:`telegram`}),`, `,_jsx(_components.code,{children:`slack`}),`, `,_jsx(_components.code,{children:`meta`}),`, `,_jsx(_components.code,{children:`crisp`}),`, `,_jsx(_components.code,{children:`zapier`}),`, `,_jsx(_components.code,{children:`mail`}),`, `,_jsx(_components.code,{children:`mercadolibre`}),`, `,_jsx(_components.code,{children:`agent_builder`}),`, `,_jsx(_components.code,{children:`chatwoot`}),`, `,_jsx(_components.code,{children:`crmchatsappai`}),`.`]})}),`\n`,_jsxs(ParamField,{body:`channelExternalId`,type:`string`,id:`param-channel-external-id`,children:[_jsx(_components.p,{children:`External channel identifier for integration with third-party systems. Format varies by integration:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`WhatsApp`}),`: `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`]}),_jsx(_components.p,{children:`Used to link messages from external platforms to conversations in Laburen.`}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`For WhatsApp Embedding`}),`: The `,_jsx(_components.code,{children:`channelExternalId`}),` is `,_jsx(_components.strong,{children:`essential`}),` to ensure messages are placed in the correct conversation. Without it, messages may be added to the wrong conversation thread.`]})})]}),`\n`,_jsx(ParamField,{body:`isDraft`,type:`boolean`,default:`false`,id:`param-is-draft`,children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`true`}),`, creates a draft message. Requires authentication.`]})}),`\n`,_jsx(ParamField,{body:`contactId`,type:`string`,id:`param-contact-id`,children:_jsx(_components.p,{children:`ID of an existing contact to associate with the conversation.`})}),`\n`,_jsx(Heading,{level:`4`,id:`optional-contact`,children:`Optional - Contact`}),`\n`,_jsxs(ParamField,{body:`contact`,type:`object`,id:`param-contact`,children:[_jsx(_components.p,{children:`Contact data to create or associate with the conversation. If a contact with matching email, phone number, or userId exists, it will be used. Otherwise, a new contact will be created.`}),_jsxs(Expandable,{title:`Contact object`,children:[_jsx(ParamField,{body:`email`,type:`string`,id:`param-email`,children:_jsx(_components.p,{children:`Contact’s email address.`})}),_jsx(ParamField,{body:`phoneNumber`,type:`string`,id:`param-phone-number`,children:_jsx(_components.p,{children:`Contact’s phone number.`})}),_jsx(ParamField,{body:`userId`,type:`string`,id:`param-user-id`,children:_jsx(_components.p,{children:`External user ID from your system.`})}),_jsx(ParamField,{body:`firstName`,type:`string`,id:`param-first-name`,children:_jsx(_components.p,{children:`Contact’s first name.`})}),_jsx(ParamField,{body:`lastName`,type:`string`,id:`param-last-name`,children:_jsx(_components.p,{children:`Contact’s last name.`})})]})]}),`\n`,_jsx(Heading,{level:`4`,id:`optional-metadata`,children:`Optional - Metadata`}),`\n`,_jsxs(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:[_jsx(_components.p,{children:`Additional metadata for the message.`}),_jsxs(Expandable,{title:`Metadata object`,children:[_jsx(ParamField,{body:`contextDataAgents`,type:`string`,id:`param-context-data-agents`,children:_jsx(_components.p,{children:`Context data for WhatsApp integrations.`})}),_jsx(ParamField,{body:`channel`,type:`string`,id:`param-channel-1`,children:_jsxs(_components.p,{children:[`Channel override (alternative to top-level `,_jsx(_components.code,{children:`channel`}),` field).`]})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response-without-streaming`,children:`Response (without streaming)`}),`\n`,_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id`,children:_jsx(_components.p,{children:`ID of the created message.`})}),`\n`,_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-1`,children:_jsx(_components.p,{children:`ID of the conversation (save this to continue adding messages to the same conversation).`})}),`\n`,_jsx(ResponseField,{name:`visitorId`,type:`string`,id:`param-visitor-id-1`,children:_jsx(_components.p,{children:`ID of the visitor/user.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[`Conversation status (e.g., `,_jsx(_components.code,{children:`UNRESOLVED`}),`, `,_jsx(_components.code,{children:`RESOLVED`}),`).`]})}),`\n`,_jsx(Heading,{level:`3`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`UNAUTHORIZED`}),_jsxs(_components.td,{children:[`Missing or invalid authentication when `,_jsx(_components.code,{children:`isDraft`}),` is `,_jsx(_components.code,{children:`true`}),`, or when required for the operation.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`NOT_FOUND`}),_jsx(_components.td,{children:`Agent with the specified ID does not exist.`})]})]})]}),`\n`,`\n`,`\n`,_jsx(Heading,{level:`3`,id:`integration-examples`,children:`Integration Examples`}),`\n`,_jsx(Heading,{level:`4`,id:`whatsapp-embedding-integration`,children:`WhatsApp Embedding Integration`}),`\n`,_jsx(_components.p,{children:`When integrating with WhatsApp via our app`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{$json.contacts[0].wa_id}}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{ $('Combino mensaje con cada fletero').last().json.mensaje}}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"streaming\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"whatsapp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channelExternalId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{organizationId}_{agentId}_{{$json.contacts[0].wa_id}}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`channelExternalId`}),` format: `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Critical`}),`: The `,_jsx(_components.code,{children:`channelExternalId`}),` is `,_jsx(_components.strong,{children:`essential`}),` for WhatsApp Embedding integration. Without it, messages will not be placed in the correct conversation thread. Always include this field with the exact format `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`}),` when using WhatsApp channel.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`chatwoot`,children:`Chatwoot`}),`\n`,_jsx(_components.p,{children:`For our chatwoot or external ones:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"crmchatsappai_{accountId}_{customerId}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Your message text here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"crmchatsappai_{accountId}_{customerId}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"streaming\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Critical`}),`: The `,_jsx(_components.code,{children:`conversationId`}),` format is `,_jsx(_components.strong,{children:`essential`}),` for Chatwoot/CRM integrations. Use the exact format `,_jsx(_components.code,{children:`crmchatsappai_{accountId}_{customerId}`}),` to match existing conversations. Without the correct format, messages will not be placed in the correct conversation thread.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Agent - Query Agent","api":"POST https://dashboard.laburen.com/api/agents/{id}/query-agent","description":"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.","href":"/api-reference/endpoint/agents/query-agent"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Expandable,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`Key Features:`})}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`Add agent messages to existing or new conversations`}),`\n`,_jsx(_components.li,{children:`Support for external channel integrations (WhatsApp, Chatwoot, CRM)`}),`\n`,_jsx(_components.li,{children:`Automatic contact creation and association`}),`\n`]}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`This endpoint is different from the `,_jsx(_components.a,{href:`/api-reference/endpoint/agents/query`,children:`Query endpoint`}),`, which sends user messages and receives AI responses. This endpoint is for adding agent messages to the conversation history.`]})}),`\n`,_jsx(Heading,{level:`3`,id:`path`,children:`Path`}),`\n`,_jsx(ParamField,{path:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The ID of the agent (CUID format).`})}),`\n`,_jsx(Heading,{level:`3`,id:`body`,children:`Body`}),`\n`,_jsx(Heading,{level:`4`,id:`required`,children:`Required`}),`\n`,_jsx(ParamField,{body:`query`,type:`string`,required:true,id:`param-query`,children:_jsx(_components.p,{children:`The agent message text to add to the conversation history.`})}),`\n`,_jsx(Heading,{level:`4`,id:`optional-basic-configuration`,children:`Optional - Basic Configuration`}),`\n`,_jsx(ParamField,{body:`streaming`,type:`boolean`,default:`false`,id:`param-streaming`,children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`true`}),`, responds with Server-Sent Events in real-time.`]})}),`\n`,_jsxs(ParamField,{body:`conversationId`,type:`string`,id:`param-conversation-id`,children:[_jsx(_components.p,{children:`ID of the conversation to add the message to. Auto-generated if not provided.`}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`For Chatwoot/CRM integrations`}),`: The `,_jsx(_components.code,{children:`conversationId`}),` format is `,_jsx(_components.strong,{children:`essential`}),` to ensure messages are placed in the correct conversation. Use the format `,_jsx(_components.code,{children:`crmchatsappai_{accountId}_{customerId}`}),` to match existing conversations. Without the correct format, messages may be added to the wrong conversation thread.`]})})]}),`\n`,_jsx(ParamField,{body:`visitorId`,type:`string`,id:`param-visitor-id`,children:_jsx(_components.p,{children:`Unique ID of the visitor/user. Auto-generated if not provided.`})}),`\n`,_jsx(ParamField,{body:`channel`,type:`string`,default:`api`,id:`param-channel`,children:_jsxs(_components.p,{children:[`Source channel for the message. Valid values: `,_jsx(_components.code,{children:`api`}),`, `,_jsx(_components.code,{children:`dashboard`}),`, `,_jsx(_components.code,{children:`website`}),`, `,_jsx(_components.code,{children:`form`}),`, `,_jsx(_components.code,{children:`whatsapp`}),`, `,_jsx(_components.code,{children:`telegram`}),`, `,_jsx(_components.code,{children:`slack`}),`, `,_jsx(_components.code,{children:`meta`}),`, `,_jsx(_components.code,{children:`crisp`}),`, `,_jsx(_components.code,{children:`zapier`}),`, `,_jsx(_components.code,{children:`mail`}),`, `,_jsx(_components.code,{children:`mercadolibre`}),`, `,_jsx(_components.code,{children:`agent_builder`}),`, `,_jsx(_components.code,{children:`chatwoot`}),`, `,_jsx(_components.code,{children:`crmchatsappai`}),`.`]})}),`\n`,_jsxs(ParamField,{body:`channelExternalId`,type:`string`,id:`param-channel-external-id`,children:[_jsx(_components.p,{children:`External channel identifier for integration with third-party systems. Format varies by integration:`}),_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`WhatsApp`}),`: `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`]}),_jsx(_components.p,{children:`Used to link messages from external platforms to conversations in Laburen.`}),_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`For WhatsApp Embedding`}),`: The `,_jsx(_components.code,{children:`channelExternalId`}),` is `,_jsx(_components.strong,{children:`essential`}),` to ensure messages are placed in the correct conversation. Without it, messages may be added to the wrong conversation thread.`]})})]}),`\n`,_jsx(ParamField,{body:`isDraft`,type:`boolean`,default:`false`,id:`param-is-draft`,children:_jsxs(_components.p,{children:[`If `,_jsx(_components.code,{children:`true`}),`, creates a draft message. Requires authentication.`]})}),`\n`,_jsx(ParamField,{body:`contactId`,type:`string`,id:`param-contact-id`,children:_jsx(_components.p,{children:`ID of an existing contact to associate with the conversation.`})}),`\n`,_jsx(Heading,{level:`4`,id:`optional-contact`,children:`Optional - Contact`}),`\n`,_jsxs(ParamField,{body:`contact`,type:`object`,id:`param-contact`,children:[_jsx(_components.p,{children:`Contact data to create or associate with the conversation. If a contact with matching email, phone number, or userId exists, it will be used. Otherwise, a new contact will be created.`}),_jsxs(Expandable,{title:`Contact object`,children:[_jsx(ParamField,{body:`email`,type:`string`,id:`param-email`,children:_jsx(_components.p,{children:`Contact’s email address.`})}),_jsx(ParamField,{body:`phoneNumber`,type:`string`,id:`param-phone-number`,children:_jsx(_components.p,{children:`Contact’s phone number.`})}),_jsx(ParamField,{body:`userId`,type:`string`,id:`param-user-id`,children:_jsx(_components.p,{children:`External user ID from your system.`})}),_jsx(ParamField,{body:`firstName`,type:`string`,id:`param-first-name`,children:_jsx(_components.p,{children:`Contact’s first name.`})}),_jsx(ParamField,{body:`lastName`,type:`string`,id:`param-last-name`,children:_jsx(_components.p,{children:`Contact’s last name.`})})]})]}),`\n`,_jsx(Heading,{level:`4`,id:`optional-metadata`,children:`Optional - Metadata`}),`\n`,_jsxs(ParamField,{body:`metadata`,type:`object`,id:`param-metadata`,children:[_jsx(_components.p,{children:`Additional metadata for the message.`}),_jsxs(Expandable,{title:`Metadata object`,children:[_jsx(ParamField,{body:`contextDataAgents`,type:`string`,id:`param-context-data-agents`,children:_jsx(_components.p,{children:`Context data for WhatsApp integrations.`})}),_jsx(ParamField,{body:`channel`,type:`string`,id:`param-channel-1`,children:_jsxs(_components.p,{children:[`Channel override (alternative to top-level `,_jsx(_components.code,{children:`channel`}),` field).`]})})]})]}),`\n`,_jsx(Heading,{level:`3`,id:`response-without-streaming`,children:`Response (without streaming)`}),`\n`,_jsx(ResponseField,{name:`messageId`,type:`string`,id:`param-message-id`,children:_jsx(_components.p,{children:`ID of the created message.`})}),`\n`,_jsx(ResponseField,{name:`conversationId`,type:`string`,id:`param-conversation-id-1`,children:_jsx(_components.p,{children:`ID of the conversation (save this to continue adding messages to the same conversation).`})}),`\n`,_jsx(ResponseField,{name:`visitorId`,type:`string`,id:`param-visitor-id-1`,children:_jsx(_components.p,{children:`ID of the visitor/user.`})}),`\n`,_jsx(ResponseField,{name:`status`,type:`string`,id:`param-status`,children:_jsxs(_components.p,{children:[`Conversation status (e.g., `,_jsx(_components.code,{children:`UNRESOLVED`}),`, `,_jsx(_components.code,{children:`RESOLVED`}),`).`]})}),`\n`,_jsx(Heading,{level:`3`,id:`error-responses`,children:`Error Responses`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status Code`}),_jsx(_components.th,{children:`Type`}),_jsx(_components.th,{children:`Description`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`401`}),_jsx(_components.td,{children:`UNAUTHORIZED`}),_jsxs(_components.td,{children:[`Missing or invalid authentication when `,_jsx(_components.code,{children:`isDraft`}),` is `,_jsx(_components.code,{children:`true`}),`, or when required for the operation.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:`404`}),_jsx(_components.td,{children:`NOT_FOUND`}),_jsx(_components.td,{children:`Agent with the specified ID does not exist.`})]})]})]}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL (WhatsApp Integration)`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --location`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer \u003cAPI_KEY>'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data-raw `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"visitorId\": \"{{$json.contacts[0].wa_id}}\",`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"query\": \"{{ $('Combino`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` mensaje`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` con`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` cada`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` fletero').last().json.mensaje}}\",`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"streaming\": false,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"channel\": \"whatsapp\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"channelExternalId\": \"cmepre3cg0194pmyckdoynlud_cmi4us1tn03ekn1lr7vf230e9_{{ $json.contacts[0].wa_id }}\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`cURL (CRM Integration)`,numberOfLines:`10`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`10`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --location`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Authorization: Bearer 844b4b95-bd79-4583-b6df-83bfa10a8f42'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--header `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Content-Type: application/json'`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`--data-raw `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"visitorId\": \"crmchatsappai_27_REMPLAZAR_ID\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"query\": \"¡Hola [NOMBRE]! Hace un tiempo recibimos tu consulta por el proyecto Osten Tower. Te escribimos para adelantarte el lanzamiento de Osten Tower II. ¡No te pierdas la oportunidad de ser parte de este increíble emprendimiento en Puerto Madero!¿Te gustaría saber más?\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversationId\": \"crmchatsappai_27_REMPLAZAR_ID\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"streaming\": false,`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"channel\": \"api\"`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`}'`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`28`,language:`javascript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` apiUrl`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'https://dashboard.laburen.com/api'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` apiKey`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cAPI_KEY>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` agentId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'clxxxxxxxxxxxxxxxxx'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Add agent message to conversation`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiUrl`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/agents/`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`agentId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"/query-agent`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'POST'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Content-Type'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'application/json'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Authorization'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `Bearer \"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`apiKey`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` query:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Hello! How can I help you today?'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` visitorId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'visitor-abc123'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` conversationId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'clxxxxxxxxxxxxxxxxx'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Optional: to add to existing conversation`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` channel:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'whatsapp'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` channelExternalId:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'org123_agent456_+1234567890'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`// Format: {organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` contact:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` phoneNumber:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '+1234567890'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` firstName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'John'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` lastName:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'Doe'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }),`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Message ID:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`messageId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'Conversation ID:'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`conversationId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`30`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`30`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://dashboard.laburen.com/api\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_key `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"\u003cAPI_KEY>\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"clxxxxxxxxxxxxxxxxx\"`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Add agent message to conversation`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_url`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/agents/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`agent_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`/query-agent\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Bearer `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`api_key`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Hello! How can I help you today?\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"visitor-abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"clxxxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Optional: to add to existing conversation`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"channel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"whatsapp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"channelExternalId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"org123_agent456_+1234567890\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`# Format: {organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"contact\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"phoneNumber\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"+1234567890\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"firstName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"John\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"lastName\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Doe\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`data `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` response.json()`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Message ID:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"messageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Conversation ID:\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, data[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`])`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`Response`,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"messageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"clxxxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"clxxxxxxxxxxxxxxxxx\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"visitor-abc123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"UNRESOLVED\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})}),`\n`,_jsx(Heading,{level:`3`,id:`integration-examples`,children:`Integration Examples`}),`\n`,_jsx(Heading,{level:`4`,id:`whatsapp-embedding-integration`,children:`WhatsApp Embedding Integration`}),`\n`,_jsx(_components.p,{children:`When integrating with WhatsApp via our app`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{$json.contacts[0].wa_id}}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{{ $('Combino mensaje con cada fletero').last().json.mensaje}}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"streaming\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"whatsapp\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channelExternalId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{organizationId}_{agentId}_{{$json.contacts[0].wa_id}}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`channelExternalId`}),` format: `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`})]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Critical`}),`: The `,_jsx(_components.code,{children:`channelExternalId`}),` is `,_jsx(_components.strong,{children:`essential`}),` for WhatsApp Embedding integration. Without it, messages will not be placed in the correct conversation thread. Always include this field with the exact format `,_jsx(_components.code,{children:`{organizationId}_{agentId}_{telephoneNumber}`}),` when using WhatsApp channel.`]})}),`\n`,_jsx(Heading,{level:`4`,id:`chatwoot`,children:`Chatwoot`}),`\n`,_jsx(_components.p,{children:`For our chatwoot or external ones:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`7`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`7`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"visitorId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"crmchatsappai_{accountId}_{customerId}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"query\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Your message text here\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"conversationId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"crmchatsappai_{accountId}_{customerId}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"streaming\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`false`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"channel\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"api\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Critical`}),`: The `,_jsx(_components.code,{children:`conversationId`}),` format is `,_jsx(_components.strong,{children:`essential`}),` for Chatwoot/CRM integrations. Use the exact format `,_jsx(_components.code,{children:`crmchatsappai_{accountId}_{customerId}`}),` to match existing conversations. Without the correct format, messages will not be placed in the correct conversation thread.`]})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Agent - Query Agent","api":"POST https://dashboard.laburen.com/api/agents/{id}/query-agent","description":"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.","href":"/api-reference/endpoint/agents/query-agent"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Path","slug":"path","depth":3,"children":[]},{"title":"Body","slug":"body","depth":3,"children":[]},{"title":"Required","slug":"required","depth":4,"children":[]},{"title":"Optional - Basic Configuration","slug":"optional-basic-configuration","depth":4,"children":[]},{"title":"Optional - Contact","slug":"optional-contact","depth":4,"children":[]},{"title":"Optional - Metadata","slug":"optional-metadata","depth":4,"children":[]},{"title":"Response (without streaming)","slug":"response-without-streaming","depth":3,"children":[]},{"title":"Error Responses","slug":"error-responses","depth":3,"children":[]},{"title":"Integration Examples","slug":"integration-examples","depth":3,"children":[]},{"title":"WhatsApp Embedding Integration","slug":"whatsapp-embedding-integration","depth":4,"children":[]},{"title":"Chatwoot","slug":"chatwoot","depth":4,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL (WhatsApp Integration)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --location\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization: Bearer \u0026#x3C;API_KEY>'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--data-raw \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"visitorId\": \"{{$json.contacts[0].wa_id}}\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"query\": \"{{ $('Combino\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> mensaje\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> con\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> cada\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> fletero').last().json.mensaje}}\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"streaming\": false,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"channel\": \"whatsapp\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"channelExternalId\": \"cmepre3cg0194pmyckdoynlud_cmi4us1tn03ekn1lr7vf230e9_{{ $json.contacts[0].wa_id }}\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"cURL (CRM Integration)","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"10\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --location\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://dashboard.laburen.com/api/agents/cm68elcks00a0y7qaeljq2qin/query-agent'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Authorization: Bearer 844b4b95-bd79-4583-b6df-83bfa10a8f42'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--header \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">--data-raw \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"visitorId\": \"crmchatsappai_27_REMPLAZAR_ID\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"query\": \"¡Hola [NOMBRE]! Hace un tiempo recibimos tu consulta por el proyecto Osten Tower. Te escribimos para adelantarte el lanzamiento de Osten Tower II. ¡No te pierdas la oportunidad de ser parte de este increíble emprendimiento en Puerto Madero!¿Te gustaría saber más?\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"conversationId\": \"crmchatsappai_27_REMPLAZAR_ID\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"streaming\": false,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"channel\": \"api\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">}'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"28\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> apiUrl\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'https://dashboard.laburen.com/api'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> apiKey\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '\u0026#x3C;API_KEY>'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> agentId\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'clxxxxxxxxxxxxxxxxx'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\">// Add agent message to conversation\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">apiUrl\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/agents/\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">agentId\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/query-agent`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'POST'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Content-Type'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'application/json'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Authorization'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> `Bearer \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">apiKey\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> query:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Hello! How can I help you today?'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> visitorId:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'visitor-abc123'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> conversationId:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'clxxxxxxxxxxxxxxxxx'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\">// Optional: to add to existing conversation\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> channel:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'whatsapp'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> channelExternalId:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'org123_agent456_+1234567890'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\">// Format: {organizationId}_{agentId}_{telephoneNumber}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> contact:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> phoneNumber:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '+1234567890'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> firstName:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'John'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> lastName:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Doe'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Message ID:'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">messageId\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'Conversation ID:'\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">conversationId\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"30\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">api_url \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://dashboard.laburen.com/api\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">api_key \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"\u0026#x3C;API_KEY>\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">agent_id \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"clxxxxxxxxxxxxxxxxx\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"># Add agent message to conversation\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">api_url\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/agents/\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">agent_id\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">/query-agent\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Authorization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Bearer \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">api_key\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"query\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Hello! How can I help you today?\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"visitorId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"visitor-abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"conversationId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"clxxxxxxxxxxxxxxxxx\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"># Optional: to add to existing conversation\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"channel\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"whatsapp\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"channelExternalId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"org123_agent456_+1234567890\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"># Format: {organizationId}_{agentId}_{telephoneNumber}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"contact\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"phoneNumber\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"+1234567890\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"firstName\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"John\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"lastName\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Doe\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">data \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> response.json()\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Message ID:\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, data[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"messageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">])\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Conversation ID:\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, data[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"conversationId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">])\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"messageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"clxxxxxxxxxxxxxxxxx\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"conversationId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"clxxxxxxxxxxxxxxxxx\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"visitorId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"visitor-abc123\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"UNRESOLVED\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Agent - Query Agent","path":"/api/agents/{id}/query-agent","servers":[{"url":"https://dashboard.laburen.com"}],"method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{"id":{"schema":[{"type":"string","description":"The ID of the agent (CUID format).","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"query":[{"type":"string","description":"The agent message text to add to the conversation history.","required":true}],"streaming":[{"type":"boolean","description":"If `true` , responds with Server-Sent Events in real-time."}],"conversationId":[{"type":"string","description":"ID of the conversation to add the message to. Auto-generated if not provided."}],"visitorId":[{"type":"string","description":"Unique ID of the visitor/user. Auto-generated if not provided."}],"channel":[{"type":"string","description":"Source channel for the message. Valid values: `api` , `dashboard` , `website` , `form` , `whatsapp` , `telegram` , `slack` , `meta` , `crisp` , `zapier` , `mail` , `mercadolibre` , `agent_builder` , `chatwoot` , `crmchatsappai` ."}],"channelExternalId":[{"type":"string","description":"External channel identifier for integration with third-party systems. Format varies by integration: WhatsApp : `{organizationId}_{agentId}_{telephoneNumber}` Used to link messages from external platforms to conversations in Laburen."}],"isDraft":[{"type":"boolean","description":"If `true` , creates a draft message. Requires authentication."}],"contactId":[{"type":"string","description":"ID of an existing contact to associate with the conversation."}],"contact":[{"type":"object","properties":{"email":[{"type":"string","description":"Contact’s email address."}],"phoneNumber":[{"type":"string","description":"Contact’s phone number."}],"userId":[{"type":"string","description":"External user ID from your system."}],"firstName":[{"type":"string","description":"Contact’s first name."}],"lastName":[{"type":"string","description":"Contact’s last name."}]},"description":"Contact data to create or associate with the conversation. If a contact with matching email, phone number, or userId exists, it will be used. Otherwise, a new contact will be created."}],"metadata":[{"type":"object","properties":{"contextDataAgents":[{"type":"string","description":"Context data for WhatsApp integrations."}],"channel":[{"type":"string","description":"Channel override (alternative to top-level `channel` field)."}]},"description":"Additional metadata for the message."}]}}],"examples":{"example":{"value":{"query":"\u003cstring>","streaming":true,"conversationId":"\u003cstring>","visitorId":"\u003cstring>","channel":"\u003cstring>","channelExternalId":"\u003cstring>","isDraft":true,"contactId":"\u003cstring>","contact":{"email":"\u003cstring>","phoneNumber":"\u003cstring>","userId":"\u003cstring>","firstName":"\u003cstring>","lastName":"\u003cstring>"},"metadata":{"contextDataAgents":"\u003cstring>","channel":"\u003cstring>"}}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"messageId":[{"type":"string","description":"ID of the created message."}],"conversationId":[{"type":"string","description":"ID of the conversation (save this to continue adding messages to the same conversation)."}],"visitorId":[{"type":"string","description":"ID of the visitor/user."}],"status":[{"type":"string","description":"Conversation status (e.g., `UNRESOLVED` , `RESOLVED` )."}]}}],"examples":{"example":{"value":{"messageId":"\u003cstring>","conversationId":"\u003cstring>","visitorId":"\u003cstring>","status":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"chatsappaicom","siteName":"Laburen Documentacion","title":"Agent - Query Agent - Laburen Documentacion","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-02-23T12:35:32.146Z","originalFileLocation":"api-reference/endpoint/agents/query-agent.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Laburen Documentacion\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Agent - Query Agent - Laburen Documentacion\">\u003cmeta data-mint-head property=\"og:description\" content=\"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Laburen Documentacion\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://chatsappaicom.mintlify.site/_mintlify/api/og/v2?division=Agentes\u0026amp;title=Agent+-+Query+Agent\u0026amp;description=Add+agent+messages+to+conversation+history.+Designed+for+integrating+with+external+systems+like+WhatsApp%2C+Chatwoot%2C+and+CRM+platforms+to+sync+agent+messages+int\u0026amp;theme=9f73d9e571fc5e52d199e59f\u0026amp;signature=b09142c150f2aae9f358bdc9bc74893035cad5e3fa815248df53b48b186128ea\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Agent - Query Agent - Laburen Documentacion\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://chatsappaicom.mintlify.site/_mintlify/api/og/v2?division=Agentes\u0026amp;title=Agent+-+Query+Agent\u0026amp;description=Add+agent+messages+to+conversation+history.+Designed+for+integrating+with+external+systems+like+WhatsApp%2C+Chatwoot%2C+and+CRM+platforms+to+sync+agent+messages+int\u0026amp;theme=9f73d9e571fc5e52d199e59f\u0026amp;signature=b09142c150f2aae9f358bdc9bc74893035cad5e3fa815248df53b48b186128ea\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/chatsappaicom/aOs9D1gzrnhM7pD5/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Laburen Documentacion\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2DFD8E\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoint/agents/query-agent.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.laburen.com/#organization\",\"name\":\"Laburen Documentacion\",\"url\":\"https://docs.laburen.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/chatsappaicom/X5lst3Tqt1FgRzc5/logo/light.png?fit=max\u0026auto=format\u0026n=X5lst3Tqt1FgRzc5\u0026q=85\u0026s=36f7a5dd80146c505715bd5f7132b1bf\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.laburen.com#website\",\"name\":\"Laburen Documentacion\",\"url\":\"https://docs.laburen.com\",\"publisher\":{\"@id\":\"https://docs.laburen.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent#webpage\",\"url\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent\",\"name\":\"Agent - Query Agent\",\"description\":\"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\",\"dateModified\":\"2026-02-23T12:35:32.146Z\",\"isPartOf\":{\"@id\":\"https://docs.laburen.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Endpoints\",\"item\":\"https://docs.laburen.com/api-reference/endpoint/agents/query\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Agentes\",\"item\":\"https://docs.laburen.com/api-reference/endpoint/agents/query\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Agent - Query Agent\",\"item\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent#apireference\",\"headline\":\"Agent - Query Agent\",\"name\":\"Agent - Query Agent\",\"description\":\"Add agent messages to conversation history. Designed for integrating with external systems like WhatsApp, Chatwoot, and CRM platforms to sync agent messages into the conversation thread.\",\"url\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent\",\"mainEntityOfPage\":{\"@id\":\"https://docs.laburen.com/api-reference/endpoint/agents/query-agent#webpage\"},\"dateModified\":\"2026-02-23T12:35:32.146Z\",\"publisher\":{\"@id\":\"https://docs.laburen.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.laburen.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Laburen Documentacion\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Laburen Documentacion\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/api-reference/endpoint/agents/query-agent.md","siteName":"Laburen Documentacion","nav":{"global":null,"anchors":[{"anchor":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/introduction"}]},{"anchor":"Agentes","icon":"hat-wizard","pages":[{"title":"Agentes","href":"/agent/inicio-rapido"}]},{"anchor":"Datastore","icon":"brain","pages":[{"title":"Datastore","href":"/datastore/inicio-rapido"}]},{"anchor":"Integraciones","icon":"puzzle-piece","pages":[{"title":"Integraciones","href":"/integrations/google-drive"}]},{"anchor":"API","icon":"rectangle-terminal","groups":[{"group":"laburen API","pages":[{"title":"Autenticación","href":"/api-reference/authentication"}]},{"group":"Endpoints","pages":[{"group":"Agentes","pages":[{"title":"Agent - Query","api":"POST https://dashboard.laburen.com/api/agents/{agentId}/query","href":"/api-reference/endpoint/agents/query"},{"title":"Agent - Follow-up Query","api":"POST https://dashboard.laburen.com/api/agents/{agentId}/follow-up/query","description":"Run the follow-up agent on demand over a conversation and get the message it would send, without waiting for the scheduled worker.","href":"/api-reference/endpoint/agents/follow-up-query"},{"title":"Agent - Query Agent","api":"POST https://dashboard.laburen.com/api/agents/{id}/query-agent","href":"/api-reference/endpoint/agents/query-agent"},{"title":"Agent - Export Conversations","api":"GET https://dashboard.laburen.com/api/agents/{id}/conversations-export","description":"Export conversation history for an agent as a CSV file with filtering options","href":"/api-reference/endpoint/agents/conversations-export"}]},{"group":"Annotations","pages":[{"title":"Annotation - List","api":"GET https://dashboard.laburen.com/api/annotations","href":"/api-reference/endpoint/annotations/list"},{"title":"Annotation - Create or Update","api":"POST https://dashboard.laburen.com/api/annotations","href":"/api-reference/endpoint/annotations/create"},{"title":"Annotation - Get","api":"GET https://dashboard.laburen.com/api/annotations/{id}","href":"/api-reference/endpoint/annotations/get"},{"title":"Annotation - Update","api":"PATCH https://dashboard.laburen.com/api/annotations/{id}","href":"/api-reference/endpoint/annotations/update"},{"title":"Annotation - Delete","api":"DELETE https://dashboard.laburen.com/api/annotations/{id}","href":"/api-reference/endpoint/annotations/delete"},{"title":"Annotation Tags - List","api":"GET https://dashboard.laburen.com/api/annotations/tags","href":"/api-reference/endpoint/annotations/tags/list"},{"title":"Annotation Tags - Create","api":"POST https://dashboard.laburen.com/api/annotations/tags","href":"/api-reference/endpoint/annotations/tags/create"},{"title":"Annotation Tags - Delete","api":"DELETE https://dashboard.laburen.com/api/annotations/tags/{id}","href":"/api-reference/endpoint/annotations/tags/delete"}]},{"group":"Consumption Events","pages":[{"title":"Consumption Events - List","api":"GET https://dashboard.laburen.com/api/consumption-events","href":"/api-reference/endpoint/consumption-events/list"},{"title":"Consumption Events - Summary","api":"GET https://dashboard.laburen.com/api/consumption-events/summary","href":"/api-reference/endpoint/consumption-events/summary"}]},{"group":"Credits","pages":[{"title":"Credits - Balance","api":"GET https://dashboard.laburen.com/api/credits/balance","href":"/api-reference/endpoint/credits/balance"}]},{"group":"Usage","pages":[{"title":"Usage - Increment Agent Queries","api":"POST https://dashboard.laburen.com/api/usage/increment-agent-queries","href":"/api-reference/endpoint/usage/increment-agent-queries"}]},{"title":"Transcribe Audio","api":"POST https://dashboard.laburen.com/api/transcribe-audio","href":"/api-reference/endpoint/transcribe-audio"}]}]},{"anchor":"support@laburen.com","icon":"comment-question","href":"mailto:support@laburen.com"}]},"basePath":"","title":"Agent - Query Agent - Laburen Documentacion","deploymentId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","buildId":"dpl_Em2U4NQQ2N2DE3HPbPUJVZLnAtvc","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-_HcdDqS2.js","snippetPresets-CXnm-WO6.js","utils-Dg59J__o.js","style-to-object-BY3JEAdk.js","utils-D8TRpdk7.js","v4-DIgz8zy6.js","addUniqueKeysToSchema-B6QaxWc5.js","conditional-requirements-CFM0id0Q.js","cloneDeep-DeMZ-lcM.js","_Uint8Array-BjA2mcVW.js","isObject-FP1Yky1u.js","ApiExamples-cjPyMv63.js","usePlaygroundInputsStore-D7BWoaw4.js","shallow-Z1ceDNSG.js","isEqual-BObTuQrO.js","CodeSnippets-D1UZ1AE-.js","CodeSnippet-B373COAT.js","getApiPlaygroundDisplay-CfL-UuDS.js","Page-DuqezyvM.js","DynamicMarkdown-5yMTCLas.js","SectionHeading-BxT1HYfP.js","icon-DYJTTD3g.js","MethodPill-4AyycJeu.js","getPastedJson-Bp3WV6cN.js","Check2Icon-PhZu6Gry.js","axios-CsQoIw0U.js"]}