# Reply to Received Email

> POST /emails/receiving/:id/reply — threaded reply to the sender; plus AI reply intent.

`POST /emails/receiving/:id/reply`

Sends a reply to the received email's sender, threaded into the same conversation (In-Reply-To the received Message-ID; subject defaults to `Re: …`). `from` must be an address on one of your verified domains.

**Body parameters**

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `from` | string | Yes | A verified sending address. |
| `html` | string | No | Reply body (or `text`). |
| `text` | string | No | Plain-text body (or `html`). |
| `subject` | string | No | Optional; defaults to `Re: <received subject>`. |
| `attachments` | array | No | Optional files to send with the reply — same shape and limits as [POST /emails](https://www.sendping.co/docs/api/emails-send): `{ filename, content (base64) | path (URL), content_type?, content_id? }`, 25MB per file / 40MB total. |

**Node.js**

```js
import { SendPing } from 'sendping';

const mb = new SendPing('mb_xxxxxxxxx');

const { data, error } = await mb.emails.receiving.reply('56761188-7520-42d8-8898-ff6fc54ce618', {
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
});
console.log({ data, error });
```

**Ruby**

```ruby
require "sendping"

SendPing.api_key = "mb_xxxxxxxxx"

SendPing::Emails::Receiving.reply("56761188-7520-42d8-8898-ff6fc54ce618", {
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
})
```

**PHP**

```php
<?php
require 'vendor/autoload.php';

use SendPing\SendPing;

$sendping = SendPing::client('mb_xxxxxxxxx');

$sendping->emails->receiving->reply('56761188-7520-42d8-8898-ff6fc54ce618', [
  'from' => "Acme <hello@yourdomain.com>",
  'html' => "<p>Thanks — on it!</p>"
]);
```

**Python**

```python
import sendping

sendping.api_key = "mb_xxxxxxxxx"

sendping.Emails.Receiving.reply("56761188-7520-42d8-8898-ff6fc54ce618", {
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
})
```

**Go**

```go
import "github.com/shekhu10/sendping-sdks/sendping-go"

client := sendping.NewClient("mb_xxxxxxxxx")

replied, err := client.Emails.Receiving.Reply("56761188-7520-42d8-8898-ff6fc54ce618", &sendping.ReplyReceivedEmailRequest{
    From: "Acme <hello@yourdomain.com>",
    Html: "<p>Thanks — on it!</p>",
})
```

**Rust**

```rust
use sendping::{ReplyReceivedEmailOptions, SendPing};

let mb = SendPing::new("mb_xxxxxxxxx");

let params = ReplyReceivedEmailOptions::new("Acme <hello@yourdomain.com>")
    .with_html("<p>Thanks — on it!</p>");
let _replied = mb.emails.receiving.reply("56761188-7520-42d8-8898-ff6fc54ce618", params).await?;
```

**Java**

```java
import co.sendping.SendPing;
import co.sendping.SendPingResponse;
import co.sendping.requests.ReplyEmailRequest;

SendPing sendping = new SendPing("mb_xxxxxxxxx");

ReplyEmailRequest request = ReplyEmailRequest.builder()
        .from("Acme <hello@yourdomain.com>")
        .html("<p>Thanks — on it!</p>")
        .build();

SendPingResponse response = sendping.emails().receiving().reply(
        "56761188-7520-42d8-8898-ff6fc54ce618",
        request);
```

**.NET**

```csharp
using SendPing;

ISendPing sendping = SendPingClient.Create("mb_xxxxxxxxx");

var resp = await sendping.ReceivedEmailReplyAsync("56761188-7520-42d8-8898-ff6fc54ce618", new ReceivedEmailReplyOptions
{
    From = "Acme <hello@yourdomain.com>",
    HtmlBody = "<p>Thanks — on it!</p>",
});
```

**cURL**

```bash
curl -X POST 'https://www.sendping.co/api/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618/reply' \
  -H 'Authorization: Bearer mb_xxxxxxxxx' \
  -H 'Content-Type: application/json' \
  -d '{
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
}'
```

**CLI**

```bash
sendping emails receiving reply 56761188-7520-42d8-8898-ff6fc54ce618 \
  --from 'Acme <hello@yourdomain.com>' \
  --html '<p>Thanks — on it!</p>'
```

### Response

```json
{
  "object": "email",
  "id": "6278820d-2421-42d0-85f0-80e9e28c1c69"
}
```

The response is the outbound email's id — the reply is sent like any other email and shows up in your sent mail and logs. Provide `html` or `text` (or both); omitting both — or omitting `from` — returns a `422 missing_required_field`. The recipient is derived from the received email's `Reply-To` header (falling back to its `From`). See [Errors](https://www.sendping.co/docs/api/errors).

## AI reply intent

Inbound replies are automatically classified as `interested`, `neutral`, or `not_interested` (surfaced as `category` on received emails and as a badge in the dashboard). Classification uses your configured AI model, with a built-in fallback — it never delays ingestion.
