> ## Documentation Index
> Fetch the complete documentation index at: https://knowledge.flowella.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Fix WhatsApp error 131047: the 24-hour window has closed

> WhatsApp error 131047 means free text was sent after the 24-hour window closed. Reach the contact with a template or smart reply, and avoid it in HubSpot.

**Error 131047** means a free-form message was sent after the contact's 24-hour window had closed. WhatsApp only delivers free-form messages inside that window. Outside it, you need an approved template.

> [!NOTE]
>
> Meta's wording: *More than 24 hours have passed since the recipient last replied to the sender number.* Meta's fix is to send a [template message](https://developers.facebook.com/documentation/business-messaging/whatsapp/templates/overview) instead.

## What causes it

The 24-hour window is Meta's [customer service window](https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-messages#customer-service-windows). It opens when a contact messages your WhatsApp number and lasts 24 hours from their latest message. Inside it you can send free-form messages, such as plain text. When it closes, free-form messages fail with 131047. See [The 24-hour customer service window](https://knowledge.flowella.io/app/inbox.md#the-24-hour-customer-service-window).

The Flowella Inbox switches to templates for you when the window closes, so the error usually comes from somewhere else:

* **Send WhatsApp Message** in a HubSpot workflow. This action sends plain text and doesn't check the window first.
* The Flowella API, when you send a text message with `POST /v1/messages`.

## How to confirm it in Flowella

* **Inbox.** The failed message has a red alert icon and the reason underneath: "The 24-hour messaging window has closed. Send an approved template to reach this contact again." The thread header shows **Window closed**.
* **HubSpot.** The failed step's **Error code** output is `FLOWELLA_META:re_engagement_required`, and the workflow history shows the same code.

## How to fix it

Reach the contact with a message that WhatsApp allows outside the window.

* **From the Inbox.** Use the **Reply** tab to send your own text inside the Service smart reply template. Or select **Re-engage** to send the Service template with a standard follow-up, or use the **Send template** tab to pick an approved template. See [Replying after the window closes](https://knowledge.flowella.io/app/inbox.md#replying-after-the-window-closes).
* **From a HubSpot workflow.** Replace **Send WhatsApp Message** with **Send WhatsApp Reply**. It sends text while the window is open, and the Service smart reply template when it's closed. Or use **Send WhatsApp Template** with an approved template. See [Send WhatsApp Reply](https://knowledge.flowella.io/hubspot/workflow-actions.md#send-whatsapp-reply).
* **From the HubSpot inbox.** Free text replies after the window closes are sent inside the Service smart reply template when it's enabled and approved. If it isn't, use a **Re-engage** chip. See [When the 24-hour window is closed](https://knowledge.flowella.io/hubspot/custom-channel.md#when-the-24-hour-window-is-closed).
* **From the API.** Send an approved template with `POST /v1/templates/send`.

Don't resend the same free-form message. It keeps failing with 131047 until the contact messages you again.

Smart replies are templates, so Meta charges them as template messages. See [Smart replies](https://knowledge.flowella.io/settings/reply-templates.md) and [Pricing and categories](https://knowledge.flowella.io/account/pricing-and-conversation-categories.md).

## How to prevent it

* Use **Send WhatsApp Reply** for follow-ups that may run more than 24 hours after the contact's last message, for example after a long delay in a workflow.
* Before a **Send WhatsApp Message** step, branch on the contact's **Last WhatsApp reply at** property. Flowella updates it each time the contact replies, when **CRM contacts (auto-create on new WhatsApp chat)** is unlocked in **Settings → HubSpot**. Send plain text only when the reply was less than 24 hours ago. **Send WhatsApp Message** always sends from your default number, so this works when contacts reply to that number. See [Last WhatsApp reply contact properties](https://knowledge.flowella.io/hubspot/contact-activity.md#last-whatsapp-reply-contact-properties).
* Give contacts an easy way to message you first, such as a [click-to-chat link or QR code](https://knowledge.flowella.io/campaigns/click-to-chat.md). Each message they send opens a new 24-hour window.

> [!TIP]
>
> **Send WhatsApp Reply** has a **Skip if window is closed** option. When it's ticked and the window has closed, the step doesn't send anything and fails with `SESSION_CLOSED_SKIPPED`, so the workflow can carry on.

## Related codes

| Code | What it's about | Guide |
| - | - | - |
| **131049** | WhatsApp's limit on marketing messages to this contact | [Error 131049](https://knowledge.flowella.io/whatsapp/limits/per-user-marketing-limit.md) |
| **131050** | The contact stopped marketing messages from your business | [Error 131050](https://knowledge.flowella.io/whatsapp/errors/error-131050.md) |

## Related

* [WhatsApp error codes](https://knowledge.flowella.io/whatsapp/errors/error-codes.md)
* [Messages not delivered](https://knowledge.flowella.io/troubleshooting/messages-not-delivered.md)
* [Smart replies](https://knowledge.flowella.io/settings/reply-templates.md)
* [HubSpot workflow actions](https://knowledge.flowella.io/hubspot/workflow-actions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.