whatsapp.cloud_api: operational·bsp: meta_business_partner·regions: la / eu·sdk: v2.1.4·cli: v0.2.22
// WHATSAPP CLOUD API · BSP META

whatsapp.cloud/*

Conecta números, envía cualquier tipo de mensaje, recibe 12 webhooks en tiempo real y orquesta tu agente IA sobre WhatsApp Cloud API. Todo por SDK, CLI, REST o Workers — sin BSP intermedio y con plantillas aprobadas directo desde Meta.

├── bsp meta oficial · plantillas aprobadas
├── 7 tipos de mensaje · 12 eventos webhook
└── sdk · cli · rest · workers — misma API
read the docs
~/send.ts·typescript
01// send.ts — WhatsApp Cloud API · BSP Meta
02import { Plazbot } from "plazbot"
03 
04const bot = new Plazbot({
05 apiKey: process.env.PLAZBOT_KEY!,
06 workspaceId: "ws_...",
07 zone: "LA" // LA | EU
08})
09 
10// envía una plantilla aprobada con variables
11await bot.message.onConversation({
12 to: "5491123456789",
13 template: "welcome",
14 variablesBody: [{ variable: "1", value: "Ana" }]
15})
16 
message.queued · id: msg_018f... · status: accepted
// CAPABILITIES · 10 ÍTEMS · SDK · CLI · REST

whatsapp.capabilities/*

Todo lo que puedes hacer sobre WhatsApp desde el código. Cada ítem mapea a un método real del SDK (v2.1.4) o un comando del CLI (v0.2.22). Sin invenciones.

$ capabilities.total = 10 · verificadas contra plazbot-sdk@2.1.4 + plazbot-cli@0.2.22
// MESSAGE TYPES · 3 SURFACES · MISMA OP

messages.flow/*

La misma operación expresada en SDK TypeScript, CLI Bash y REST HTTP. Body y parámetros idénticos — elige la superficie según el contexto (app vs ops vs cualquier stack).

[01]
texto plano
mensaje libre — ventana de 24h abierta
~/send-text.ts·ts
await bot.message.onWhatsappMessage({
to: "51912345678",
message: "Hola Ana, gracias por escribir.",
})
[02]
plantilla con variables
HSM aprobada — abre ventana / inicia conversación
~/send-template.ts·ts
await bot.message.onConversation({
to: "51912345678",
template: "welcome",
variablesBody: [{ variable: "1", value: "Ana" }],
variablesHeader: [{ variable: "1", value: "Q3 2025" }],
})
[03]
plantilla con archivo
imagen, documento o video como header media
~/send-template-file.ts·ts
await bot.message.onConversation({
to: "51912345678",
template: "factura_mensual",
variablesBody: [{ variable: "1", value: "Ana" }],
file: {
fileUrl: "https://cdn.tu-app.com/facturas/u/123.pdf",
fileName: "factura.pdf",
},
})
$ base.url = https://api.plazbot.com | https://apieu.plazbot.com · auth: Bearer + x-workspace-id
// WEBHOOKS · 12 EVENTOS EN TIEMPO REAL · POST JSON

webhooks.stream/*

Registra una URL y recibe los 12 eventos del ciclo de vida de WhatsApp en JSON. Mismo wrapper PlazbotEvent para todos — discriminado por type.

message.*
Mensajes entrantes por tipo de contenido
4 eventos
  • [01]message.receivedtexto
  • [02]message.image.receivedimagen
  • [03]message.audio.receivedaudio
  • [04]message.document.receiveddocumento
contact.*
Ciclo de vida del contacto
5 eventos
  • [01]contact.creatednuevo contacto creado
  • [02]contact.existingcontacto ya conocido interactuó
  • [03]contact.deletedcontacto eliminado
  • [04]contact.blockedcontacto bloqueado
  • [05]contact.from.adclick-to-WhatsApp desde anuncio
conversation.*
Estado de la conversación
3 eventos
  • [01]conversation.assignedasignada a agente / miembro
  • [02]conversation.resolvedmarcada como resuelta
  • [03]conversation.reopenedreabierta
~/register.ts·typescript
await bot.message.registerWebhook({
number: "51912345678",
url: "https://tu-app.com/wa-events",
})
~/types/events.ts·typescript
01// shape verificado en plazbot-sdk v2.1.4
02interface PlazbotEvent {
03 type: PlazbotEventType // uno de los 12 literales
04 workspaceId: string
05 timestamp: string // ISO-8601
06 data: PlazbotEventData
07}
08 
09interface PlazbotEventData {
10 contact?: EventContact
11 message?: EventMessage
12 conversation?: EventConversation
13 metadata?: Record<string, unknown>
14}
15 
16interface EventMessage {
17 id: string
18 content?: string
19 contentUrl?: string
20 contentType: 'text' | 'image' | 'audio' | 'document' | 'video' | 'location' | 'sticker'
21 platform: 'whatsapp' | 'telegram' | 'instagram' | 'webchat'
22 direction: 'incoming' | 'outgoing'
23 timestamp: string
24}
25 
26interface EventContact {
27 id: string
28 name?: string
29 phoneNumber?: string
30 email?: string
31 tags?: string[]
32 stage?: string
33 assignedAgentId?: string
34 assignedAgentName?: string
35 variables?: Record<string, string>
36}
37 
38interface EventConversation {
39 contactId: string
40 isSolved: boolean
41 assignedAgentId?: string
42 assignedMemberId?: string
43 lastMessageAt?: string
44}
POST · ejemplo · message.image.received·json
01// POST https://tu-app.com/wa-events
02{
03 "type": "message.image.received",
04 "workspaceId": "ws_018f...",
05 "timestamp": "2025-05-24T13:42:01.812Z",
06 "data": {
07 "contact": {
08 "id": "cnt_018f...",
09 "name": "Ana Quispe",
10 "phoneNumber": "51912345678",
11 "tags": ["lead", "ventas"]
12 },
13 "message": {
14 "id": "msg_018f...",
15 "contentUrl": "https://media.plazbot.com/.../img.jpg",
16 "contentType": "image",
17 "platform": "whatsapp",
18 "direction": "incoming",
19 "timestamp": "2025-05-24T13:42:01.700Z"
20 }
21 }
22}
// REGIONS · 2 ZONAS · ZONE-AWARE

regions.{la,eu}/*

El SDK resuelve el host según la zona del workspace. Elige la región correcta y el cliente apunta automáticamente al host operativo de esa zona.

zone: LA
Latinoamérica
operational
baseUrl
https://api.plazbot.com

Cobertura para América Latina, Caribe y Estados Unidos

  • ├── BSP Meta operando 24/7 con plantillas locales
  • ├── Soporte en español y portugués
  • └── Optimizado para tráfico desde MX · CO · PE · CL · AR · BR
~/client.ts·typescript
const bot = new Plazbot({
apiKey: process.env.PLAZBOT_KEY!,
workspaceId: "ws_...",
zone: "LA",
})
zone: EU
Europa
operational
baseUrl
https://apieu.plazbot.com

Cobertura para Europa con residencia de datos en la región

  • ├── Procesamiento y almacenamiento dentro de la UE
  • ├── Compatible con requisitos de GDPR / soberanía de datos
  • └── Optimizado para tráfico desde ES · PT · IT · FR · DE
~/client.ts·typescript
const bot = new Plazbot({
apiKey: process.env.PLAZBOT_KEY!,
workspaceId: "ws_...",
zone: "EU",
})
└── on-premise / cluster dedicado: new Plazbot({ apiKey, workspaceId, customUrl: "https://api.tu-cluster.com" })
// QUICKSTART · 3 PASOS · DEL INSTALL AL PRIMER MESSAGEID

whatsapp.quickstart/*

Tres pasos copia-pega para mandar tu primera plantilla a un número real. Requiere PLAZBOT_KEY y PLAZBOT_WORKSPACE_ID (los obtienes en el panel).

  1. step [01/03]
    instala el SDK

    Un solo paquete. Sin dependencias externas extra.

    ~/terminal·bash
    01$ npm install plazbot
    02# o si prefieres CLI global para ops:
    03$ npm install -g plazbot
  2. step [02/03]
    inicializa el cliente

    Lleva apiKey, workspaceId y zona (LA / EU). El host se resuelve solo.

    ~/lib/plazbot.ts·typescript
    01import { Plazbot } from "plazbot"
    02 
    03export const bot = new Plazbot({
    04 apiKey: process.env.PLAZBOT_KEY!,
    05 workspaceId: process.env.PLAZBOT_WORKSPACE_ID!,
    06 zone: "LA", // "LA" | "EU"
    07})
  3. step [03/03]
    manda tu primer mensaje

    Plantilla aprobada con variables. La respuesta trae messageId para tracking.

    ~/scripts/welcome.ts·typescript
    01import { bot } from "@/lib/plazbot"
    02 
    03const res = await bot.message.onConversation({
    04 to: "51912345678",
    05 template: "welcome",
    06 variablesBody: [{ variable: "1", value: "Ana" }],
    07})
    08 
    09console.log(res.messageId) // → "msg_018f..."
// READY ? · 3 PASOS · 10 CAPABILITIES · 12 WEBHOOKS

$ build.with.whatsapp/*

Crea tu workspace gratis, conecta un número y manda tu primera plantilla en minutos. Si necesitas volumen, BSP dedicado u on-premise, hablamos.

~/developers/whatsapp · end-of-file · press [↑] to scroll