---
title: "Update a draft"
method: PATCH
path: "/v1/mailboxes/{id}/drafts/{draftId}"
tags: ["Mailboxes"]
---

# Update a draft

`PATCH /v1/mailboxes/{id}/drafts/{draftId}`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/mailboxes/{id}/drafts/{draftId}`
- Auth: API key in header `x-api-key`

Updates the fields you name and keeps the rest; `null` clears an optional field. A draft whose send waits for approval cannot change and conflicts.

## Path parameters

- `id` string, required
- `draftId` string, required

## Request body

- UpdateMailboxDraftPayload
  - `to` string[], nullable
  - `cc` string[], nullable
  - `bcc` string[], nullable
  - `replyTo` string[], nullable
  - `subject` string, nullable
  - `text` string, nullable
  - `html` string, nullable
  - `attachments` EmailAttachment[], nullable
    - `filename` string, required
    - `content` string, nullable
    - `mediaId` string
    - `contentType` string, required
    - `size` integer, required

## Response `200`

MailboxDraft

- MailboxDraft
  - `id` string, required
  - `channel` 'email', required
  - `threadId` string, required
  - `inReplyToMessageId` string, required
  - `state` 'saved' | 'locked' | 'sent', required
  - `lockedByActionId` string, required
  - `to` string[], required
  - `subject` string, nullable, required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `endpointId` string, required
  - `cc` string[], required
  - `bcc` string[], required
  - `replyTo` string[], required
  - `html` string, nullable, required
  - `text` string, nullable, required
  - `attachments` EmailAttachment[], required
    - `filename` string, required
    - `content` string, nullable
    - `mediaId` string
    - `contentType` string, required
    - `size` integer, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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