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

# Reply to an inbound message

> Send a free-form text reply to an inbound WhatsApp message within the 24-hour conversation window.

<RequestExample>
  ```javascript Node.js theme={null}
  import Prelude from "@prelude.so/sdk";

  const client = new Prelude();

  async function main() {
    const response = await client.notify.reply({
      to: "+33612345678",
      text: "Thanks for reaching out! We'll look into your request.",
      reply_to: "im_01k8aq2zggeyssvt53zgvpx63a",
    });

    console.log(response.id);
  }

  main();
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"

  	"github.com/prelude-so/go-sdk"
  	"github.com/prelude-so/go-sdk/option"
  )

  func main() {
  	client := prelude.NewClient()

  	response, err := client.Notify.Reply(context.TODO(), prelude.NotifyReplyParams{
  		To:      prelude.F("+33612345678"),
  		Text:    prelude.F("Thanks for reaching out! We'll look into your request."),
  		ReplyTo: prelude.F("im_01k8aq2zggeyssvt53zgvpx63a"),
  	})
  	if err != nil {
  		panic(err.Error())
  	}

  	fmt.Printf("%+v\n", response.ID)
  }
  ```

  ```python Python theme={null}
  import os
  from prelude_python_sdk import Prelude

  client = Prelude()

  response = client.notify.reply(
      to="+33612345678",
      text="Thanks for reaching out! We'll look into your request.",
      reply_to="im_01k8aq2zggeyssvt53zgvpx63a",
  )

  print(response.id)
  ```
</RequestExample>

<Note>
  Replies are delivered as native WhatsApp quoted messages and must be sent within the **24-hour conversation window** that follows the latest inbound message from the same user. See [WhatsApp 2-Way Messaging](/notify/v2/documentation/whatsapp) for the full flow.
</Note>

## Request fields

<ParamField path="to" type="string" required>
  The recipient's phone number in E.164 format. Must match the phone number that sent the original inbound message — otherwise a `phone_number_mismatch` error is returned.
</ParamField>

<ParamField path="text" type="string" required>
  The reply message body. Sent as a free-form WhatsApp text, not as a template.
</ParamField>

<ParamField path="reply_to" type="string" required>
  The inbound message ID (prefixed with `im_`) to reply to. This ID is provided in the `inbound.message.received` webhook event.
</ParamField>

<ParamField path="callback_url" type="string">
  The URL where webhooks will be sent for delivery events of this reply.
</ParamField>

<ParamField path="correlation_id" type="string">
  A user-defined identifier to correlate this reply with your internal systems. It is returned in the response and any webhook events that refer to this message.
</ParamField>

## Error Handling

The reply endpoint returns specific error codes for 2-way messaging failures:

| Error Code              | Description                                               | Action                                                                                             |
| ----------------------- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `window_expired`        | The 24-hour WhatsApp conversation window has closed       | Use a template-based message via [Send a message](/notify/v2/api-reference/send-a-message) instead |
| `invalid_reply_context` | The inbound message ID in `reply_to` was not found        | Verify the message ID from the `inbound.message.received` webhook                                  |
| `phone_number_mismatch` | The `to` number does not match the inbound message sender | Use the phone number from the inbound webhook                                                      |
| `missing_text`          | The `text` field is empty                                 | Provide a reply message body                                                                       |
| `invalid_phone_number`  | Phone number format is invalid                            | Validate phone number format                                                                       |
| `insufficient_balance`  | Account balance is too low                                | Top up your account                                                                                |

For a complete list of errors, see the [Error documentation](/introduction/errors).

## Related Documentation

* [WhatsApp 2-Way Messaging](/notify/v2/documentation/whatsapp) - Receive inbound messages and send replies
* [Send a message](/notify/v2/api-reference/send-a-message) - Send templated transactional and marketing messages
* [Webhooks](/notify/v2/documentation/webhook) - Receive delivery updates, inbound messages, and subscription events


## OpenAPI

````yaml post /v2/notify/reply
openapi: 3.1.0
info:
  title: Prelude API
  version: 2.0.0
  description: The Prelude API allows you to send messages to your users.
  contact:
    email: support@prelude.so
servers:
  - url: https://api.prelude.dev
    description: Production server
security:
  - apiToken: []
tags:
  - name: Notify
    description: Send transactional and marketing messages with compliance enforcement.
  - name: Transactional
    description: Send transactional messages (deprecated - use Notify API instead).
  - name: Verify
    description: Verify phone numbers.
  - name: Watch
    description: Evaluate email addresses and phone numbers for trustworthiness.
  - name: Lookup
    description: >-
      Retrieve detailed information about a phone number including carrier data,
      line type, and portability status.
paths:
  /v2/notify/reply:
    post:
      tags:
        - Notify
      summary: Reply to an inbound message
      description: >-
        Send a free-form text reply to an inbound WhatsApp message within the
        24-hour conversation window. See [WhatsApp 2-Way
        Messaging](/notify/v2/documentation/whatsapp) for details.
      operationId: sendNotifyReply
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendNotifyReplyRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SendNotifyReplyResponse'
        '400':
          description: KO
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      callbacks:
        webhook_event:
          '{$request.body#/callback_url}':
            post:
              requestBody:
                required: true
                content:
                  application/json:
                    schema:
                      $ref: '#/components/schemas/WebhookEvent'
              responses:
                '200':
                  description: Your server accepted the event and will process it.
                default:
                  description: >-
                    Your server did not accept the event and we will retry for
                    24 hours.
components:
  schemas:
    SendNotifyReplyRequest:
      type: object
      properties:
        to:
          type: string
          description: >-
            The recipient's phone number in E.164 format. Must match the phone
            number that sent the original inbound message.
          examples:
            - '+33612345678'
        text:
          type: string
          description: The reply message body sent as a free-form WhatsApp text.
          examples:
            - Thanks for reaching out! We'll look into your request.
        reply_to:
          type: string
          description: >-
            The inbound message ID (prefixed with `im_`) to reply to. This ID is
            provided in the `inbound.message.received` webhook event.
          examples:
            - im_01k8aq2zggeyssvt53zgvpx63a
        callback_url:
          type: string
          description: >-
            The URL where webhooks will be sent for delivery events of this
            reply.
          examples:
            - https://your-app.com/webhooks/notify
        correlation_id:
          type: string
          description: >-
            A user-defined identifier to correlate this reply with your internal
            systems. It is returned in the response and any webhook events that
            refer to this message.
          maxLength: 80
          examples:
            - support-ticket-42
      required:
        - to
        - text
        - reply_to
    SendNotifyReplyResponse:
      type: object
      properties:
        id:
          type: string
          description: The reply message identifier.
          examples:
            - tx_01k8ap1btqf5r9fq2c8ax5fhc9
        to:
          type: string
          description: The recipient's phone number in E.164 format.
          examples:
            - '+33612345678'
        text:
          type: string
          description: The reply message body that was sent.
          examples:
            - Thanks for reaching out! We'll look into your request.
        reply_to:
          type: string
          description: The inbound message ID this reply was sent in response to.
          examples:
            - im_01k8aq2zggeyssvt53zgvpx63a
        callback_url:
          type: string
          description: The callback URL where webhooks will be sent.
          examples:
            - https://your-app.com/webhooks/notify
        correlation_id:
          type: string
          description: >-
            The user-defined correlation identifier echoed back from the
            request.
          maxLength: 80
          examples:
            - support-ticket-42
        created_at:
          type: string
          format: date-time
          description: The reply creation date in RFC3339 format.
          examples:
            - '2025-10-24T12:00:00Z'
      required:
        - id
        - to
        - text
        - reply_to
        - created_at
    Error:
      type: object
      properties:
        code:
          type: string
          description: The error code.
          examples:
            - invalid_phone_number
        message:
          type: string
          examples:
            - >-
              The provided phone number is invalid. Provide a valid E.164 phone
              number.
          description: A human-readable message describing the error.
        type:
          type: string
          examples:
            - bad_request
          description: The error type.
        request_id:
          type: string
          examples:
            - 3d19215e-2991-4a05-a41a-527314e6ff6a
          description: >-
            A string that identifies this specific request. Report it back to us
            to help us diagnose your issues.
      required:
        - code
        - message
        - type
  securitySchemes:
    apiToken:
      type: http
      scheme: bearer

````