Messages

ToolREST endpointAnnotations
send_messagePOST /v1/messageswrite, non-destructive
send_template_messagePOST /v1/messages/templatewrite, non-destructive

send_message

Sends a personalized message inside an existing conversation. The tool resolves the conversation via conversationId and channelId; if there are several conversations for the same phone number, it uses the most recent one that matches the channel. For WhatsApp, Instagram, and Facebook, the service window must be open.

Arguments

FieldTypeRequiredDescription
channelIdstringyesChannel of the agent that will send the message.
conversationIdstringyesCustomer's phone number or conversation identifier.
contentstring \| objectyesPlain text, structured content for media/interactive messages, or an instruction for the agent.
type"text" \| "image" \| "video" \| "file" \| "audio" \| "interactive" \| "email" \| "instruction"noMessage type when content is an object. If content is a string, text is used.
clientobjectnoCustomer data (name, email, customFields, owners, …) used to create/enrich them.
campaignIdstringnoGroups the send under a campaign. Default "api".
delaynumber msnoSchedule with a delay (3000-86,400,000 ms).
scheduleTimeISO 8601noSchedule with an exact date. Mutually exclusive with delay.

Invocation example

{
  "name": "send_message",
  "arguments": {
    "channelId": "wb-12345",
    "conversationId": "+521234567890",
    "content": "Hola, te escribo desde Platica API",
    "client": {
      "name": "Ana López",
      "customFields": {
        "placas": "ABC123"
      }
    }
  }
}

Media example

{
  "name": "send_message",
  "arguments": {
    "channelId": "wb-12345",
    "conversationId": "+521234567890",
    "type": "image",
    "content": {
      "image": {
        "url": "https://cdn.assets.com/foto.jpg",
        "caption": "Aquí está la foto"
      }
    }
  }
}

Agent instruction example

An instruction does not reach the customer: it is applied to the agent operating the conversation. Use mode: "wait" to have the agent wait for the next customer message with the instruction recorded as context, or mode: "resume" to resume the agent so it continues the flow.

{
  "name": "send_message",
  "arguments": {
    "channelId": "wb-12345",
    "conversationId": "+521234567890",
    "type": "instruction",
    "content": {
      "text": "Continúa con el flujo de venta y ofrece un descuento del 10%.",
      "mode": "resume"
    }
  }
}

send_template_message

Sends a message based on an approved WhatsApp template to the customer identified by conversationId (international phone number). Creates the conversation and/or the customer if they don't exist. It can be sent immediately, with delay (in ms, minimum 3000), or with scheduleTime (ISO 8601, Mexico time if no zone is included).

Arguments

FieldTypeRequiredDescription
channelIdstringyesWhatsApp channel of the agent that will send.
conversationIdstringyesDestination phone number in E.164 format.
template.namestringyesExact template name.
template.type"image" \| "video" \| "document"noIf the template has a media header.
template.filestring (URL)noPublic file URL when type is present.
template.paramsstring[]noOrdered values for the body variables.
template.buttons[]objectnoOverride of dynamic button parameters (max 3).
template.components[]objectnoAdditional components (rarely needed).
clientobjectnoCustomer data (name, email, …) used to create/enrich them.
campaignIdstringnoGroups the send under a campaign. Default "api".
delaynumber msnoSchedule with a delay (3000-86,400,000 ms).
scheduleTimeISO 8601noSchedule with an exact date. Mutually exclusive with delay.

Invocation example

{
  "name": "send_template_message",
  "arguments": {
    "channelId": "wb-12345",
    "conversationId": "+521234567890",
    "template": {
      "name": "bienvenida_v1",
      "params": ["Ana", "10%"]
    },
    "client": {
      "name": "Ana López",
      "email": "ana@example.com"
    }
  }
}