Referência REST

Mensagens

As rotas de Mensagens. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem.

POST

/v1/messages

Send a message

Sends any message type the Cloud API supports (text, media, location, contacts, reaction, interactive buttons and lists, CTA URL, carousel, flow, product, template). Free-form messages need an open 24-hour window with the recipient; templates do not. Media is referenced by the `mediaId` returned by upload_media (`media: { path }`) or by a public `link`.

Corpo da requisição

numberIdstringObrigatório
Zaiped id (whatsappConnections)
tostringObrigatório
messageobjectObrigatório
contextWamidstring

Uma das formas abaixo, escolhida por message.type:

message.type = "text"

textstringObrigatório
previewUrlboolean

message.type = "image" | "video" | "audio" | "document" | "sticker"

mediaobjectObrigatório
captionstring
fileNamestring

message.type = "location"

latitudenumberObrigatório
longitudenumberObrigatório
namestring
addressstring

message.type = "contacts"

contactsobject[]Obrigatório

message.type = "reaction"

wamidstringObrigatório
emojistringObrigatório

message.type = "buttons"

headerobject
bodystringObrigatório
footerstring
buttonsobject[]Obrigatório

message.type = "list"

headerstring
bodystringObrigatório
footerstring
buttonstringObrigatório
sectionsobject[]Obrigatório

message.type = "cta_url"

headerobject
bodystringObrigatório
footerstring
buttonTextstringObrigatório
urlstringObrigatório

message.type = "carousel"

bodystringObrigatório
mediaKind"image" | "video"Obrigatório
cardButton"url" | "reply"Obrigatório
cardsobject[]Obrigatório

message.type = "location_request"

bodystringObrigatório

message.type = "flow"

flowIdstringObrigatório
Zaiped id (flows)
headerobject
bodystringObrigatório
footerstring
ctastringObrigatório

message.type = "product"

bodystring
footerstring
retailerIdstringObrigatório

message.type = "product_list"

headerstringObrigatório
bodystringObrigatório
footerstring
sectionsobject[]Obrigatório

message.type = "catalog_message"

bodystringObrigatório
footerstring
thumbnailRetailerIdstring

message.type = "call_permission"

bodystringObrigatório

message.type = "template"

templateIdstringObrigatório
Zaiped id (templates)
valuesobjectObrigatório

Resposta (object)

wamidstringObrigatório
tostringObrigatório
status"accepted" | "held_for_quality_assessment"Obrigatório
curl -X POST "https://zaiped.com/v1/messages" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…",
  "to": "…",
  "message": {
    "type": "text",
    "text": "…"
  }
}'
POST

/v1/messages/{wamid}/read

Mark a received message as read

Optionally shows the typing indicator for up to 25 seconds.

Parâmetros de caminho

wamidstringObrigatório
The WhatsApp message id (`wamid`) of the received message.

Corpo da requisição

numberIdstringObrigatório
Zaiped id (whatsappConnections)
typingboolean

Resposta (object)

oktrueObrigatório
curl -X POST "https://zaiped.com/v1/messages/YOUR_WAMID/read" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…"
}'
POST

/v1/blocked

Block a phone number

Meta only allows blocking users who messaged the number in the last 24 hours.

Corpo da requisição

numberIdstringObrigatório
Zaiped id (whatsappConnections)
phonestringObrigatório

Resposta (object)

oktrueObrigatório
curl -X POST "https://zaiped.com/v1/blocked" \
  -H "Authorization: Bearer zp_..." \
  -H "Content-Type: application/json" \
  -d '{
  "numberId": "…",
  "phone": "…"
}'
DELETE

/v1/blocked/{numberId}/{phone}

Unblock a phone number

Parâmetros de caminho

numberIdstringObrigatório
The number id, as returned by list_numbers.
phonestringObrigatório
The phone in E.164 (`5511999999999`).

Resposta (object)

oktrueObrigatório
curl -X DELETE "https://zaiped.com/v1/blocked/YOUR_NUMBER_ID/YOUR_PHONE" \
  -H "Authorization: Bearer zp_..."
Referência REST