# 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>`. |

**Node.js**

```js
import { MailBlastr } from 'mailblastr';

const mb = new MailBlastr('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 "mailblastr"

Mailblastr.api_key = "mb_xxxxxxxxx"

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

**PHP**

```php
$mailblastr = Mailblastr::client('mb_xxxxxxxxx');

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

**Python**

```python
import mailblastr

mailblastr.api_key = "mb_xxxxxxxxx"

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

**Go**

```go
package main

import (
    "fmt"
    "io"
    "net/http"
    "strings"
)

func main() {
    req, _ := http.NewRequest("POST", "https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618/reply", strings.NewReader(`{
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
}`))
    req.Header.Set("Authorization", "Bearer mb_xxxxxxxxx")
    req.Header.Set("Content-Type", "application/json")
    res, _ := http.DefaultClient.Do(req)
    defer res.Body.Close()
    out, _ := io.ReadAll(res.Body)
    fmt.Println(string(out))
}
```

**Rust**

```rust
use reqwest::Client;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let res = Client::new()
        .post("https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618/reply")
        .header("Authorization", "Bearer mb_xxxxxxxxx")
        .header("Content-Type", "application/json")
        .body(r#"{
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
}"#)
        .send()
        .await?;
    println!("{}", res.text().await?);
    Ok(())
}
```

**Java**

```java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618/reply"))
    .header("Authorization", "Bearer mb_xxxxxxxxx")
    .header("Content-Type", "application/json")
    .method("POST", HttpRequest.BodyPublishers.ofString("""
{
  "from": "Acme <hello@yourdomain.com>",
  "html": "<p>Thanks — on it!</p>"
}
"""))
    .build();
var response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
```

**.NET**

```csharp
using System.Net.Http;
using System.Text;

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api.mailblastr.com/emails/receiving/56761188-7520-42d8-8898-ff6fc54ce618/reply");
request.Headers.Add("Authorization", "Bearer mb_xxxxxxxxx");
request.Content = new StringContent(@"{
  ""from"": ""Acme <hello@yourdomain.com>"",
  ""html"": ""<p>Thanks — on it!</p>""
}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
Console.WriteLine(await response.Content.ReadAsStringAsync());
```

**cURL**

```bash
curl -X POST 'https://api.mailblastr.com/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
mailblastr 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.mailblastr.com/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.
