# Create a draft

**`POST https://myagentmail.com/v1/inboxes/{id}/drafts`**

Group: Drafts
Operation ID: `createDraft`

## Path parameters

- `id` (string, required) — Inbox UUID

## Request body

Content-Type: `application/json`

```json
{
  "subject": "string",
  "plainBody": "string",
  "htmlBody": "string",
  "replyToMessageId": "00000000-0000-0000-0000-000000000000"
}
```

## Responses

### 201 — Created

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "inboxId": "00000000-0000-0000-0000-000000000000",
  "to": [
    "agent@example.com"
  ],
  "cc": [
    "agent@example.com"
  ],
  "bcc": [
    "agent@example.com"
  ],
  "subject": "string",
  "plainBody": "string",
  "htmlBody": "string",
  "replyToMessageId": "00000000-0000-0000-0000-000000000000",
  "createdAt": "2026-05-01T08:11:44.618Z",
  "updatedAt": "2026-05-01T08:11:44.618Z"
}
```

## Code samples

### TypeScript

```typescript
import { MyAgentMail } from "myagentmail";

const client = new MyAgentMail({ apiKey: process.env.MYAGENTMAIL_API_KEY! });

// POST /v1/inboxes/{id}/drafts
const result = await client.request("post", "/v1/inboxes/{id}/drafts", { params: { id: "00000000-0000-0000-0000-000000000000" } }, { body: {
  "subject": "string",
  "plainBody": "string",
  "htmlBody": "string",
  "replyToMessageId": "00000000-0000-0000-0000-000000000000"
} });
```

### curl

```bash
curl -X POST 'https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/drafts' \
  -H 'X-API-Key: $MYAGENTMAIL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "subject": "string",
  "plainBody": "string",
  "htmlBody": "string",
  "replyToMessageId": "00000000-0000-0000-0000-000000000000"
}'
```

### Python

```python
import os, requests

r = requests.post(
    "https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/drafts",
    headers={"X-API-Key": os.environ["MYAGENTMAIL_API_KEY"]},
    json={
        "subject": "string",
        "plainBody": "string",
        "htmlBody": "string",
        "replyToMessageId": "00000000-0000-0000-0000-000000000000"
    },
)
r.raise_for_status()
print(r.json())
```
