---
title: "Replace a draft"
method: PUT
path: "/mailboxes/{address}/drafts/{uid}"
tags: ["Drafts"]
---

# Replace a draft

`PUT /mailboxes/{address}/drafts/{uid}`

## Request

- Base URL: `https://faivelo.com/api/v1`
- URL: `https://faivelo.com/api/v1/mailboxes/{address}/drafts/{uid}`
- Auth: HTTP bearer

Replaces the whole draft with the request body. A stored message cannot be edited in place, so the draft comes back under a **new** `uid` and the old one stops existing. Requires scope `mail:write`.

## Path parameters

- `address` string, required
- `uid` integer, required

## Request body

- DraftRequest
  - `to` string: Comma-separated recipients
  - `cc` string
  - `bcc` string
  - `subject` string
  - `text` string
  - `html` string
  - `replyTo` string, email
  - `fromName` string: From display name the draft is sent under; default: the mailbox's name
  - `inReplyTo` string: Message-ID being replied to, so the draft threads correctly
  - `references` string
  - `attachments` object[]: Up to 10 files, 10 MB in total
    - `filename` string, required
    - `content` string, required: Base64-encoded file content
    - `contentType` string, required

## Response `200`

Draft replaced

- object
  - `success` boolean
  - `data` DraftResponse
    - `uid` integer: The draft's UID in the Drafts folder
    - `replayed` boolean: Present and true when an Idempotency-Key matched an earlier request

## Other responses

- `401`: Missing or invalid API key
- `402`: The account's plan does not include the API (`plan_required`)
- `403`: The key lacks the required scope
- `404`: Resource not found
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/faivelo/apis/faivelo-api.md) · [All operations](https://skmtc.dev/faivelo/apis/faivelo-api/llms.txt) · [OpenAPI document](https://skmtc.dev/faivelo/apis/faivelo-api/revisions/a7413ddea5d1?raw)
