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

# Reply in-thread

> POST /v1/emails/{id}/reply — reply to a message; threading is handled for you.

Reply to a message in one call. Drin threads it for you: From defaults to the parent's inbox, To to the parent's sender, the subject gets a Re: prefix, and the In-Reply-To / References headers are set.

**`POST /v1/emails/{id}/reply`**

Reply to an `inbound` message and the new message lands in the same thread on the recipient's side. The body is optional — every field below has a sensible default derived from the parent message. At minimum, supply `html` or `text`.

## Path parameters

<ParamField body="id" type="string" required>
  The id of the message you're replying to (typically an inbound message).
</ParamField>

## Body parameters

The entire body is optional; pass only what you want to override.

<ParamField body="html" type="string">
  The HTML reply body. Provide `html`, `text`, or both.
</ParamField>

<ParamField body="text" type="string">
  The plain-text reply body.
</ParamField>

<ParamField body="subject" type="string">
  Override the subject. Defaults to the parent's subject with a `Re:` prefix.
</ParamField>

<ParamField body="from" type="object">
  Override the sender, `{ email, name? }`. Defaults to the parent's inbox address so threading stays intact.
</ParamField>

## Headers

<ParamField header="Idempotency-Key" type="header">
  Make the reply safe to retry — the same key replays the original result for 24 hours. See [Idempotency & retries](/idempotency).
</ParamField>

## Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.drin.run/v1/emails/msg_01HZX9K3T2QF7P0M4N8B6C5D/reply \
    -H "Authorization: Bearer $DRIN_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "html": "<p>Thanks for reaching out — we are on it.</p>",
      "text": "Thanks for reaching out — we are on it."
    }'
  ```

  ```typescript Node.js theme={null}
  import { DrinClient } from "@drin00/sdk";

  const drin = new DrinClient({ apiKey: process.env.DRIN_API_KEY });

  const { id, status } = await drin.emails.reply(
    "msg_01HZX9K3T2QF7P0M4N8B6C5D",
    { html: "<p>Thanks for reaching out — we're on it.</p>" },
  );
  ```
</CodeGroup>

## Response

`202 Accepted` — the reply was queued. The response is the same shape as a send: the new message's `id` and `status`.

```json 202 Accepted theme={null}
{
  "id": "msg_01HZXB7Q4R2KD9F0M1N3P5T8",
  "status": "queued"
}
```

<Note>
  **See the whole conversation.** To read both sides of a thread joined together, use [`GET /v1/threads/{id}`](/api-reference/threads/get). The guide on [replying in-thread](/receiving/reply) walks the full receive-then-reply loop.
</Note>
