Skip to content

Messaging windows & WhatsApp templates

Some channels (for example WhatsApp) enforce time-limited messaging windows: you may only send free-form text for a period after the customer’s last message. Outside that window you typically must use pre-approved templates.

Instaply provides endpoints to:

  1. Inspect the thread’s channel and whether the messaging window is open.
  2. List available WhatsApp templates for the thread.
  3. Send a template using contentSid via Send message.

Use this to see which channel the thread uses and whether free-form messages are allowed.

Endpoint: GET https://me.instaply.com/api/get-customer-thread-details?customerThreadId=<id>

Example response:

{
"customerChannel": "WHATSAPP",
"status": "replied",
"isMessagingWindowOpen": false
}
  • customerChannel — Channel type (for example WHATSAPP).
  • status — Thread status: waiting, replied, or resolved.
  • isMessagingWindowOpen (boolean) — true: free-form messages allowed. false: use templates (contentSid).

When the messaging window is closed, send an approved template. List templates for the thread:

Endpoint: GET https://me.instaply.com/api/get-whatsapp-templates?customerThreadId=<id>

Example response:

{
"templates": [
{
"title": "issue_back",
"text": "Bonjour, nous sommes désolés de ne pas avoir pu vous répondre plus tôt. Si vous êtes toujours en attente d’une réponse, veuillez répondre OUI.",
"contentSid": "HXdf71e8696fbd234e0115c69a542cb1"
}
]
}
FieldDescription
titleTemplate name
textTemplate body text
contentSidIdentifier to pass as contentSid in Send message