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

# Update a draft

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

## Request

- Base URL: `https://api.agentboxd.com`
- URL: `https://api.agentboxd.com/v1/inboxes/{id}/drafts/{draftId}`
- Auth: HTTP bearer

Same fields as create, except the reply fields. `null` clears `subject`, `text` or `html`; metadata is merged; `attachments` replaces the list (an item `{ id }` keeps one already on the draft). `send_at` schedules or reschedules, `send_at: null` unschedules. `409 draft_not_editable` unless the draft is `draft` or `scheduled`. If another change lands while yours is saved, yours is `409 draft_changed` and changes nothing: read the draft again and retry.

Permission: `drafts:write`.

## Path parameters

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

## Request body

- object
  - `to` union
    - string
    - string[]
  - `cc` union
    - string
    - string[]
  - `bcc` union
    - string
    - string[]
  - `subject` string, nullable
  - `text` string, nullable
  - `html` string, nullable
  - `attachments` union[]
    - union
      - object
        - `filename` string, required
        - `content_type` string, required
        - `content_base64` string, required
      - object
        - `id` string, uuid, required
  - `metadata` object
  - `labels` string[]
  - `send_at` string, date-time, nullable
  - `data` unknown
  - `type` 'message' | 'task' | 'event'

## Response `200`

OK

- object

## Other responses

- `4XX`: Error
- `5XX`: Error

---

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