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

# Replies in the 24-hour window

> Send free-form text, files and buttons after a person writes to you.

When a person writes to you, a **24-hour window** opens. Inside it you can send plain text, files and buttons. Outside it, send a template; otherwise you get `outside_24h_window`.

## Text

```bash cURL theme={null}
curl https://api.getreply.in/v1/messages/text \
  -H "Authorization: Bearer gr_live_…" \
  -H "Idempotency-Key: reply-4521-1" \
  -H "Content-Type: application/json" \
  -d '{"to": "+9198250*****", "text": "Your order is on its way."}'
```

```javascript Node.js theme={null}
const res = await fetch("https://api.getreply.in/v1/messages/text", {
  method: "POST",
  headers: {
    "Authorization": "Bearer gr_live_…",
    "Idempotency-Key": "reply-4521-1",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+9198250*****",
    "text": "Your order is on its way."
  }),
});
console.log(await res.json());
```

```php PHP theme={null}
<?php
$ch = curl_init("https://api.getreply.in/v1/messages/text");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer gr_live_…",
    "Idempotency-Key: reply-4521-1",
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => '{"to": "+9198250*****", "text": "Your order is on its way."}',
]);
echo curl_exec($ch);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://api.getreply.in/v1/messages/text",
    headers={
        "Authorization": "Bearer gr_live_…",
        "Idempotency-Key": "reply-4521-1",
    },
    json={
        "to": "+9198250*****",
        "text": "Your order is on its way."
    },
)
print(res.json())
```

## Buttons

```bash cURL theme={null}
curl https://api.getreply.in/v1/messages/interactive \
  -H "Authorization: Bearer gr_live_…" \
  -H "Idempotency-Key: reply-4521-2" \
  -H "Content-Type: application/json" \
  -d '{"to": "+9198250*****", "body": "Shall we deliver today?", "buttons": [{"id": "yes", "title": "Yes"}, {"id": "later", "title": "Later"}]}'
```

```javascript Node.js theme={null}
const res = await fetch("https://api.getreply.in/v1/messages/interactive", {
  method: "POST",
  headers: {
    "Authorization": "Bearer gr_live_…",
    "Idempotency-Key": "reply-4521-2",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "to": "+9198250*****",
    "body": "Shall we deliver today?",
    "buttons": [
      {
        "id": "yes",
        "title": "Yes"
      },
      {
        "id": "later",
        "title": "Later"
      }
    ]
  }),
});
console.log(await res.json());
```

```php PHP theme={null}
<?php
$ch = curl_init("https://api.getreply.in/v1/messages/interactive");
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer gr_live_…",
    "Idempotency-Key: reply-4521-2",
    "Content-Type: application/json",
  ],
  CURLOPT_POSTFIELDS => '{"to": "+9198250*****", "body": "Shall we deliver today?", "buttons": [{"id": "yes", "title": "Yes"}, {"id": "later", "title": "Later"}]}',
]);
echo curl_exec($ch);
```

```python Python theme={null}
import requests

res = requests.post(
    "https://api.getreply.in/v1/messages/interactive",
    headers={
        "Authorization": "Bearer gr_live_…",
        "Idempotency-Key": "reply-4521-2",
    },
    json={
        "to": "+9198250*****",
        "body": "Shall we deliver today?",
        "buttons": [
            {
                "id": "yes",
                "title": "Yes"
            },
            {
                "id": "later",
                "title": "Later"
            }
        ]
    },
)
print(res.json())
```

When the person taps a button you get a `message.received` webhook with the button's `id` as `reply_id`.


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