# Update a draft

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

Group: Drafts
Operation ID: `updateDraft`

Merge-patch. Omitted fields are left as-is.

## Path parameters

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

## Request body

Content-Type: `application/json`

```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.625Z",
  "updatedAt": "2026-05-01T08:11:44.625Z"
}
```

## Responses

### 200 — Updated

## Code samples

### TypeScript

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

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

// PATCH /v1/inboxes/{id}/drafts/{did}
const result = await client.request("patch", "/v1/inboxes/{id}/drafts/{did}", { params: { id: "00000000-0000-0000-0000-000000000000", did: "00000000-0000-0000-0000-000000000000" } }, { body: {
  "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.625Z",
  "updatedAt": "2026-05-01T08:11:44.625Z"
} });
```

### curl

```bash
curl -X PATCH 'https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/drafts/00000000-0000-0000-0000-000000000000' \
  -H 'X-API-Key: $MYAGENTMAIL_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "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.625Z",
  "updatedAt": "2026-05-01T08:11:44.625Z"
}'
```

### Python

```python
import os, requests

r = requests.patch(
    "https://myagentmail.com/v1/inboxes/00000000-0000-0000-0000-000000000000/drafts/00000000-0000-0000-0000-000000000000",
    headers={"X-API-Key": os.environ["MYAGENTMAIL_API_KEY"]},
    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.625Z",
        "updatedAt": "2026-05-01T08:11:44.625Z"
    },
)
r.raise_for_status()
print(r.json())
```
